3 ms·
I was reminded of Go and Forth :-) It's not really Forth because in WASM, each block of code needs to have a statically determined stack effect. I wonder if th
by skybrian 7y ago
I was reminded of Go and Forth :-)
It's not really Forth because in WASM, each block of code needs to have a statically determined stack effect. I wonder if there might be a nice Forth-like syntax for WASM, though?
- zozbot234 7y agoIt's kinda unrealistic to endow a Forth-like syntax with things like types and pre-determined stack effects. You end up with something not too different from the usual lambda syntax aside from postfix application, which in this context would simply be De Bruijn notation for lambda-like terms.
- brandonbloom 7y agoI think Factor is an existence proof that you're mistaken about this. Check out the section of the docs labeled "The stack": https://docs.factorcode.org/content/article-handbook-language-reference.html https://docs.factorcode.org/content/article-handbook-languag... Note that, in particular, there is full support for stack-effect declarations and that there is a static static-effect checker.
- abecedarius 7y agoAt https://github.com/darius/idel https://github.com/darius/idel is a Wasm-like VM I made in the early 2000s with a Forth-like source syntax and static stack effects. (Tail-call optimization too.) I regret making it a little too simple and then abandoning it -- it seemed too hard to try to get traction with such a thing.