more about #hither and that time i wrote a heap :)

https://ryleealanza.org/posts/hither-ii/

last week i added enough features to #hither, my little #forth-like language written in #zig, to be able to write a FizzBuzz.

realized that calling functions when the stack is *popped* was silly, so fixed that up and here's the complete FizzBuzz code :)

really happy with my "all functions are lambdas until you name them" choice, makes things like "while loops expect a lambda" really natural. #theWorkshop

i'm not sure how #forth implements it, but in #hither the "if" keyword (also "else" and "{") is secretly a no-op, it's "then" that actually does all the work (including digging in the stack for a matching "if"). stacks are so neat.

if you reserve the name in advance (by assigning it to the address of the "no op" function _ for example) recursion is pretty straightforward in #hither!

i say straightforward, but it definitely did take me a long time to figure out the right stack yoga for this factorial function 😅

#catlang