« first day (3839 days earlier)      last day (991 days later) » 

8:00 PM
Yeah, but I have no idea why l is the hex prefix
Wait, actually, I think I remember now :P
Commands in Deorst can be followed by a hex literal which indicates which value on the stack it should operate on (because the stack is always sorted). That's i in the lambda i, s:. However, l is clearly special-cased to be "push literal"
 
ah, so it's not l that's broken, it's everything else :p
 
Replace l with <insert character here>, and that applies to basically all of my languages :P
 
This is very tandom
 
tandom?
 
8:11 PM
*random
 
What's the difference between Eval and Exec?
 
eval (in Python) is only expressions
 
exec is code
eval can still run arbirtary code tho
@RedwolfPrograms Same
 
Sry, I meant EV and EY in Deorst
 
EY executes a string as Python code, EV tries to safe eval it
@cairdcoinheringaahing I don't think float will ever fail on something that int will succeed on, those should probably be the other way around :/
 
8:17 PM
I don't want to inflict any of you languages on myself
 
Something to do with closures
 
And people say JS is janky
 
K was hard enough - fun, but tricky. I'm probably going to keep answering in it tho/
 
@cairdcoinheringaahing I don't know why, but it seems to be something to do with the a[:]
@RedwolfPrograms Because it is
 
8:22 PM
Doesn't a[:] mean "copy to a"?
 
¯\_(ツ)_/¯
 
Oddly, this works as expected
 
@cairdcoinheringaahing this makes sense to me
 
I think it's because a is a mutable argument, and [:] actually changes it in memory, rather than reassign the name
 
yes
a[:]= means "assign to the subslice of a from start to end"
 
8:24 PM
But why does calling it multiple times reuse the same array?
 
that's just how default arguments work
 
Because Python uses mutable arrays as default arguments
 
it is a value, not an expression
 
63
Q: What is the difference between list and list[:] in python?

JingWhat, if any, is the difference between list and list[:] in python?

 
interestingly, a = a[:] can be used to clone an array and re-reference it so you can edit its arguments without mutating the array
and a[:] = ... can be used to mutate the array itself
you cannot, for example, do def f(x = f()) (unless f was already defined beforehand and you are overwriting it)
 
8:26 PM
That's really weird that a default argument that's an array uses the same array every time
If that's what's happening
 
1746
A: "Least Astonishment" and the Mutable Default Argument

robActually, this is not a design flaw, and it is not because of internals or performance. It comes simply from the fact that functions in Python are first-class objects, and not only a piece of code. As soon as you think of it this way, then it completely makes sense: a function is an object being ...

 
@cairdcoinheringaahing Btw that implementation for fibbonacci is blazing fast - it can calculate the millionth fibbonacci number on TIO in about 40 seconds.
 
That sounds blazingly slow
 
Also, does anyone want a 250-megabyte file of the first 50k fibbonacci numbers?
@RedwolfPrograms Really]
 
I think Binet's formula is one of the fastest methods for fib, no?
@Ausername I get 20 seconds
 
8:29 PM
TIO's inconsistenr, remember
 
i mean you can calculate any arbitrary fib number pretty much instantly
 
@cairdcoinheringaahing Is that the one with ø and √5? Because you need arbitrary-precision floats for that.
 
@cairdcoinheringaahing me too
 
@Ausername This basic naive method takes 12 seconds for me
 
8:33 PM
Oh nvm
I was wrong
 
this gets me about the same amount of time
 
JS's bigints are stupidly slow :/
 
8:44 PM
Interesting, this only shows output if you stop it manually; if you let it time out it shows nothing
 
That's how it always works, right?
 
Often, at least
 
That's due to Deorst's f'ed up output method
 
Ah
 
8:46 PM
print(*values, sep=sep, end=str(end), file=open('stdout.txt','a'))
i'm guessing the program has to end normally for it to flush
 
#!/usr/bin/env bash

ln -f .input.tio stdin.txt
python3 /opt/deorst/interpreter.py .code.tio "$@"
cat stdout.txt
 
never mind, seems that user is right: tio.run/##K6gsycjPM/7/…
 
That's how TIO runs it
@hyper-neutrino The Deorst code is roughly equivalent to this Python code tho
 
guess deorst is just too slow then
because that gets its output cut by the size limit, not the time limit
observe: this outputs "a": tio.run/##K6gsycjPM/7/…
because of the manual flush
 
It should hit the output limit, but that only comes into play at the cat call, whereas the python3 /opt/deorst/interpreter.py .code.tio "$@" call runs "forever" (or until it hits the time limit)
 
8:49 PM
hm
yeah that is cursed then :p
this doesn't output anything
 
If you stop the Deorst code after a bit (I gave it ~8 seconds), it hits the limit and gets truncated
 
Nothing actually gets sent to TIO's STDOUT until the cat call (it all gets sent to stdout.txt), so it's output limit isn't considered
 
that makes sense
 
So, I think that you might be able to cause a memory error if you output enough within 60 seconds in Deorst
 
this will output ~60 "a"s
 
8:52 PM
@hyper-neutrino :)
 
This will stop early because the output file gets to big
 
I think I have seen Husk or something output even if it times out, though
 
@AaronMiller UwU
 
Was the uwu intentional?
 
@user Yeah, some languages flush STDOUT every time they call to it (Jelly being one), so they will output as they go
 
8:53 PM
@user Maybe... :D
 
UwU *notices Deorst* what's this?
2
 
Jelly on CR be like
 
Make that a Community Ad :P
 
I would, but they my request to not lock them :(
 
Is there a way to print without the trailing newline in Deorst?
 
Protip: Look at your screen while typing instead of bashing your head against a wall
@Ausername caird: Time to go review my production Jelly code :P
 
@AaronMiller Oh wait, I found it.
 
Another protip: When bashing your head against a wall, don't do so violently. Also, a soft wall is preferred. If you can't buy a padded wall, tape a pillow to it before commencing your head-bashing
 
8:58 PM
@user If you violently bang your head against a wall enough times, you might be given four padded walls for free!
3
 
And a floor :P
 
@RedwolfPrograms Same thing if you violently bang someone else's head against a wall enough times ;)
 
Just get a padded head!
 
Mine's full of air, so no worries there :P
 
@user Same thing if you violently bang your head against someone else's head enough times ;)
 
9:00 PM
@Ausername I'm actually thinking about this
 
Bye
 
@RedwolfPrograms Same thing if you violently bang your head against the wall enough times ;)
 
Wait what
 
@RedwolfPrograms Same thing if you violently bang your head against the wall enough times ;)
(the joke here is that I've banged my head against a wall enough times to lose my memory and send the same message again)
(No, I have not actually banged my head against a wall)
 
Oh ok
Kind of hard to lose memory of what you said when you're staring at a transcript of it :p
 
9:06 PM
Erm, I also lost my vision
And I now have a condition that makes me say "erm" instead of "uh"
 
I step away for 5 minutes and you guys are all smashing your heads into walls ffs :P
 
Bashing, not smashing :P
Real programmers bash or zsh their heads
 
Yeah, we're not like those dummies who GUI their heads
 
9:27 PM
I know there's a joke involving "gooey" and head-bashing here, but I can't find it, and it's probably too dark anyway
 
CMC: Output 1111, 1112, 1121, 1122, 1123, 1211, 1212, 1213, 1221, 1222, 1223, 1231, 1232, 1233, 1234
(any convenient format or order, newline separated, as a list etc.)
I have 11 bytes in Jelly, in that order and format
 
9:43 PM
Like Gray code, cool
Wow, this commit involves committing? Never would've known
 
@cairdcoinheringaahing or order? so we can output any permutation?
 
@rak1507 Any permutation of the 15 items, but each item has to be as shown (so 2211 isn't in the output, but 1122 could be the first element)
 
yeah
has to be unique?
 
Yes, only those 15 items
 
@cairdcoinheringaahing Clearly I’m missing some obvious trick, but here’s Vyxal, 23 bytes: Try it Online!
 
9:52 PM
@cairdcoinheringaahing but can there be duplicates?
 
@AaronMiller 1114 shouldn't be there (or 1113)
@rak1507 No
 
ok
 
One thing to note: no digit appears in the output unless digit - 1 has also appears before it (aside from 1)
So 3 can only appear if 2 has appeared first, 2 is 1 has appeared first and 4 if 3 has already appeared
 
@cairdcoinheringaahing Whoops, accidentally did instead of ₀+. Fixed
 
I've got 21 in APL so far, but probably improvable.
 
9:56 PM
wow
I have 26 in extended
but it's using a pretty roundabout method
 
@rak1507 mine
 
@AaronMiller Wait, that’s still wrong. Try it Online!
 
@Adám ah clever
using an array of digits too
 
@rak1507 A crazy 21-byter: Try it online!
 
a/⍨{⍵≡⍵∪⍳⌈/⍵}¨a←,⍳⍳4
 
10:02 PM
Nice.
 
@cairdcoinheringaahing Brachylog, 10 bytes (generator)
1{⌉⟦∋+₁}ᵃ³
 
Ooh, nice. What's your method?
 
@Adám (20 with dzaima/APLs high-rank )
 
23 in ngn/k, gain some with #, lose some with ⎕IO←0
 
in as many ways as possible, iterate 3 times building a list starting from 1 where each successive element is 1 more than some element of [0 .. largest element of list so far]
i'm not sure why it produces them in the right order tbh
 
10:06 PM
@dzaima 18: {∧/⍵∊⍨⍳⌈/⍵}¨⍛⌿⍨⍳⍳4
 
oh wait no of course it does because it's not directly on a list
the rightmost digits are chronologically later
er
more recent
 
@Adám 17: {∧⍵∊⍨⍳⌈/⍵}¨⍛⌿⍨⍳⍳4
 
@cairdcoinheringaahing 10 bytes if outputting a list of digits
 
wait is that always how it works
i think it is
ooh
 
@dzaima Of course.
@dzaima 16: (∧⌈/⍳⍛∊⊢)¨⍛⌿⍨⍳⍳4
But there's probably a better way using ≠\
 
10:11 PM
@cairdcoinheringaahing Given how this is going, it might work as a full challenge.
 
Interesting :P This was inspired by the challenge I'm about to post :P
 
But you'd probably have to forbid hard-coding to make it interesting, so ... :\
 
Why?
 
hardcoding won't be very golfy anyway
 
For most production languages it might be the shortest
 
10:13 PM
nah, doubt it
 
@cairdcoinheringaahing Can't you extend it to N digits?
@rak1507 Do not underestimate the ungolfiness of Java!
 
lol, maybe
 
@Adám Yes, but as I said, this was inspired by the challenge I'm finalising, where it's all 4 digits
 
@Adám is this dzaima/APL?
 
Interestingly, generalising it to n digits is still 10 bytes for me in Jelly
 
10:15 PM
neat
 
@rak1507 Yes.
 
dzaima/APL doesn't have tradfns right
 
Nope.
 
is there a clever way to do the output still?
 
In bash + core utils, say you have a file and want to print "yes" for any line that matches "foo" and "bar" otherwise, what's the golfiest way to do that?
 
10:16 PM
@rak1507 ⎕←( in Header and ) in Footer.
 
thanks
RankError: ⍺ for ⌿ should have rank ≤1?
is TIO outdated?
 
Yep.
 
damn
 
@Adám Also, I think that's Gray coding, which we already have a challenge about
 
don't have it locally
 
10:17 PM
(Can Java be compiled to JavaScript?)
 
18 in extended a/⍨(∪≡∘⍳⌈/)¨a←,⍳⍳4
 
@Adám I once got dzaima/BQN running in JS with TeaVM, but never did much more with it
 
@rak1507 Or a direct translation: (∧/⌈/⍳⍛∊⊢)¨⍛⌿⍨,⍳⍳4
@rak1507 Wait, that should work for 15 in dzaima: (∪≡∘⍳⌈/)¨⍛⌿⍨⍳⍳4
 
@Adám this doesn't work it outputs 1 1 3 2 as well just noticed
@Adám yep
 
Indeed.
 
10:22 PM
fun 16: (~0∊⍸⍣¯1)¨⍛⌿⍨⍳⍳4
 
nice
 
@Adám Turns out that the number of different outputs for a given n is the nth Bell number, huh
 
dyalog extended could do with f#x for filter like k has
 
Heh, PowerPoint has begun to suggest design ideas. Sometimes it is neat (and I've actually used one such idea, with modification, once), but this time, it went bananas:
 
10:23 PM
@cairdcoinheringaahing I stumbled across that on OEIS
@Adám is this from an error handling webinar?
 
it would be 10 bytes if Œp actually accepted single integers as arguments
 
@dzaima I should have thought of that. We discussed ⍸⍣¯1 in the Array Cast that we recorded today (and we mentioned you too).
 
(and rangified hopefully)
 
@rak1507 Yes, Thursday's.
 
cool :)
you should invite arthur whitney to give the shortest error handling webinar ever: don't
 
10:25 PM
@dzaima I've wanted since I was little.
 
@Adám ⍸⍣¯1 was mentioned in the orchard recently too iirc
 
@rak1507 Yeah, we spoke about that (off the record).
 
@dzaima (note that that relies on dzaima/APLs ⍸⍣¯1 being lenient and not erroring on unsorted inputs)
 
Oh, right.
That's against Dyalog principles.
(But more in line with J.)
 
probably because a customer used ⍸⍣¯1 once to detect if something is sorted and you can't change it because it would break their entire codebase :P
 
10:28 PM
my impl does whatever i thought would be useful :)
@rak1507 it also violates the one rule about ⍣¯1
 
@rak1507 No. Because applying the function to the generated argument must give the supplied result.
 
good point
 
(Why do I have white dust all over me‽)
 
Stop it. Get some help.
 
Stop what?
 
10:31 PM
@Adám Which J principle is it more in line with?
 
@dzaima (dzaima/APL can kind of stray away from that rule because inverses in it are a well-defined concept, not a "do whatever to achieve X, otherwise error")
 
@Jonah That an inverse operation can be applied even if it doesn't "round trip":
   'xy',^:_1 'abcd'
cd
In APL, that would error because there's no 'xy' to remove.
 
@dzaima (heh, it should stick by (⊢ ≡ (F F⍣¯1)) F (F⍣¯1) x though)
 
...
4ṗŻ»\I²ƑʋƇ
 
10:35 PM
@Adám Interesting. Is there any difference between that and 2&}.?
 
@dzaima What is that? Did you join two code spans?
 
easily the silliest thing I have ever done with chains
 
@Jonah I don't think so.
I find the APL strictness useful. It allows me to state multiple conditions in the positive, to see if they have been done. An error signals that this isn't so.
 
@Adám no? it's a single code block
 
10:36 PM
Then I don't know how to parse that.
 
is that more or less what you had (and then generalized is ṗ`Ż»\I²ƑƲƇ)
 
@Adám a train applied to F (F⍣¯1) x?
 
Ah, now I see.
 
@dzaima more interestingly defined as (F F⍣¯1)⍣≡x either terminating or erroring)
 
Essentially it says that F F⍣¯1 is idempotent.
 
10:37 PM
@UnrelatedString Remove the backtick for -1 byte, and make it a dyadic filter
And mine was different to that :P
 
wouldn't it 2,1 chain without the backtick
yeah
oh yeah
ofc lmao
 
ṗŻ»\I²ƑʋƇ works as a general one for 9 bytes :P
 
@dzaima (also leads to a competitive-ish 18 1+(¬0∊/⁼)¨⊸/⥊↕1+↕4 in dzaima/BQN (for whatever reason i removed high-rank replicate from dzaima/BQN :/))
 
i don't know why i changed the filter back to monadic
it's not like monadic chains have some kind of 2,2 that niladic chains don't
 
10:41 PM
@dzaima I still like my auto-conforming replicate.
 
@UnrelatedString Niladic chains are just fancy monadic chains anyway :P
 
@Adám the one that works for arbitrary ranks for both arguments? it's of course more general & better, but pretty precisely useless
 
Until you need it.
For me, APL has always been about the generalisation.
 
oh yeah i should write a tips answer about this
 
@Adám well, generalization sucks for implementers :)
 
10:43 PM
@UnrelatedString About what? Abusing 2,2 chains in monadic chains?
 
@dzaima I don't care about implementers.
 
or the lack thereof, rather
 
@Adám Aren't you employed as an implementer?
 
Nope.
 
Like, you work on an implementation of APL?
 
10:44 PM
@Adám well, given I am the one of dzaima/APL, I kind of have to
 
@Adám That's a bit callous :/
 
@cairdcoinheringaahing I never work on the interpreter itself. (Well, directly, at least.)
@user Caring about implementers leads to bad language design.
2
 
Fair enough, although some concessions have to be made
 
Why?
That's how you end up with Ruby's mess of mutable and immutable types with no apparent rhyme or reason.
 
Like if you design a language that relies on proofs for everything, but solving them takes minutes every time you compile
 
10:46 PM
Then you get Prolog ;-)
 
Ah, but Prolog's all about the proofs :P
 
And APL is all about the generalisation. At least that's what my impression was as a young kid.
 
@dzaima (and I can't remember a time using a 3D+ array (outside of testing) willingly)
 
Speaking of, anyone want to revive the Prolog room?
 
@dzaima Someone used a 4D array in the competition's phase 1!
 
10:48 PM
@Adám can you share the code?
 
@Adám oh wow. created by what builtins?
 
I used a 5d array (momentarily) in a project euler problem
 
i think i remember that
 
but I've not gone beyond there afaik
 
We had a customer give us an ultimatum that they would leave us if we didn't increase MAXRANK beyond the current 15.
 
10:50 PM
@Adám If the interpreter's job is too complex, you'll get bugs and huge binaries/codebases, but if the language is either too complex or can't do enough it'll be a pain to use, I feel like somewhere in the middle is ideal
 
Wow, that's a unique ultimatum
 
(FWIW dfns.sudoku uses a 10D temporary array)
 
@Adám wow, seems like a strange thing to be so insistent on
 
¯\_(⍴,⍴)_/¯
 
Clearly they were working on a reference solution to their upcoming CGCC challenge: transpose a 16 rank matrix :P
 
10:51 PM
@cairdcoinheringaahing That's easy:
 
@Adám except it doesn't work in Dyalog APL
 
That's BQN.
 
ah :)
 
are you going to increase maxrank then?
 
10:53 PM
No. They went bankrupt…
 
oh
 
lol
 
Not enough ranks to meet demand I guess
 
@Adám Weirdly the the inverse of , is not documented, seemingly. , b. _1 returns "domain error".
 
convenient for you then unless they were big customers
 
10:54 PM
@rak1507 Or if they paid upfront
 
(actually no they couldn't have been that big if they went bankrupt)
 
Ever heard of the Lehmann Brothers? Or "too big to fail"?
 
@cairdcoinheringaahing yeah maybe this company was bailed out by governments :P
@Adám any chance of seeing that 4d phase 1 code?
 
I am trying my bash question one more time since @Bubbler is here: In bash + core utils, say you have a file and want to print "yes" for any line that matches "foo" and "no" otherwise, what's the golfiest way to do that?
 
@Jonah It is documented as inverses of m&, and ,&n (though they don't look quite correct)
 
10:58 PM
@rak1507 I was looking for it, but now I can't seem to find it. Maybe it was only 3D. been looking at so many submissions…
 
aw, 3d is still interesting, I definitely didn't go beyond 2d
 
@Jonah I'm not a bash expert...
 
@rak1507 Infamous P7: ((∧/2=/∘∊+/,(+/1 2 2∘⍉))⊢,[0.5]⌽)
 

« first day (3839 days earlier)      last day (991 days later) »