Re:Stem, a stack-based language with metaprogramming and a C...
by ret2pop on Saturday January 27, 2024 @12:36AM
(#39152908)
I was not aware of this, thanks for giving me an explanation. I don't have any experience writing in forth, my friend described this type of language to me and I implemented it.
[ Parent
| on HN ]
Re:Stem, a stack-based language with metaprogramming and a C...
by klyrs on Saturday January 27, 2024 @02:28AM
(#39153447)
Your language is really neat, thanks for putting it out there
Re:Stem, a stack-based language with metaprogramming and a C...
by ret2pop on Saturday January 27, 2024 @06:01PM
(#39160766)
Hey thanks! I didn't think people would actually care about this lol
Re:Stem, a stack-based language with metaprogramming and a C...
by crq-yml on Saturday January 27, 2024 @05:55AM
(#39154496)
You should go implement the FORTH-83 wordlist. (arbitrary pick, but it's easy to find documentation for the words) Doing that will reveal exactly how powerful and succinct Forth has always been, because the compilation/execution distinction in Forth is just a bitflip.
Re:Stem, a stack-based language with metaprogramming and a C...
by ret2pop on Saturday January 27, 2024 @06:00PM
(#39160758)
yes, i have actually thought about this solution independently, but i still find it a little bit ugly to have to tell the parser that everything past a certain point is runtime, if I am understanding this correctly.
Re:Stem, a stack-based language with metaprogramming and a C...
by MaxBarraclough on Saturday January 27, 2024 @05:58AM
(#39154506)
Some related goodness from Forth: there's another word, :NONAME, for defining anonymous words. [0][1]
The more common : word enters the newly defined word into the dictionary, which is Forth speak for the newly defined word now being considered 'in scope'. The :NONAME word instead returns an execution token on the stack, which is analogous to a function pointer.
See also [2], on Forth's execution model more broadly.
[0] https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Ano...