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"
Actually, 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.
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)
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
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
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?
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:
@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")
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 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
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?