Imagine getting your Forth firmware loaded with this in it, you can already do e.g. OMeta-style grammars because it's still Forth, so you can send your device a language description preamble and then just talk to it in whatever language you like, all in one stream.
FORTH is pretty awesome and I love stack machines.
After my experiences with postscript (and being a web user like everyone else) allowing for recursion when you don’t really need it freaks me out a little.
"we cannot create assembly code output from Meta II, as assemblers don’t allow for the inlining of strings."
This is actually not a major limitation. We've just been blinkered by decades of one kind of notion for "Assembler". It's actually quite easy to create a syntax atop machine code (and implemented in machine code) that provides string literals.
As evidence: I've done it. Here's the pass in my 'assembler' that implements string literals: http://akkartik.github.io/mu/html/apps/dquotes.subx.html. That page is 1925 lines long, but take out the comments and unit tests and there's only 383 lines of code (336 x86 instructions). Including library functions elsewhere (also built in machine code) the resulting binary is 6.5KB large.
There's an example up top that I'll reproduce here:
$ cat x
== code
ab "cd ef"/imm32
$ cat x | apps/dquotes
== code
ab __string1/imm32
== data
__string1:
5/imm32/length
0x63/c 0x64/d 0x20/ 0x65/e 0x66/f
All it's doing is moving string literals to the data segment and replacing their original location with the label they were moved to. Currently there's zero optimization; if you refer to "foo" 3 times you get 3 separate literals in your binary and data segment.
- generate a call to a subroutine LITERAL
- store the characters of the string directly after that call
- pad to the ‘word’ size
LITERAL does:
- pop the return address from the call stack
- from that address, compute the address of the literal
- push it to Forth’s data stack
- adjust the return address to point beyond the literal
- push the adjusted return address
- return from subroutine
For sure. I love Forth and spent a long time thinking about it [1]. I'm exploring some different trade-offs in my project, worse than Forth in some ways and hopefully better than Forth in others.
Unlikely. You should see the items google thinks are relvant for you but 10% more expensive as you belong to a user group which spends money on items with little comparable advantage above others except being more expensive for the purpose to differentiate from others.
Some people just don't care enough about their content or brand to worry about the terrible experience they give users by plastering chum all over their pages in a ridiculous attempt to pick up pennies.
Imagine getting your Forth firmware loaded with this in it, you can already do e.g. OMeta-style grammars because it's still Forth, so you can send your device a language description preamble and then just talk to it in whatever language you like, all in one stream.
( https://en.wikipedia.org/wiki/OMeta )