anecdata (and warning some people might not like that domain brought here), there's a mini vm in bitcoin that a subset of forth https://en.bitcoin.it/wiki/Script I just learned that this week
Forth: The programming language that writes itself: The Web Page
11–20 of 89 posts
Re: Forth: The programming language that writes itself: The Web Page
#12Earlier quoted context omitted.
Probably not. It turns out that it doesn't map to modern computer processors terribly well. It's an amazing and elegant language, but anything that does register-to-register operations is always going to be faster than register-to-memory.
Stack code can be mapped to register code trivially if you impose some restrictions (each word has a static effect and both branches of a conditional have the same effect). Then lowering to SSA form performs an “abstract interpretation” where evaluating a word pops SSA values from a “abstract stack”, creates an SSA node and pushes its output values on the stack.
> slavapestov
... ok, fair enough: it probably is trivial for you, lol.
(For the uninitiated: Slava Pestov created Factor, a modern concatenatvie language which (IIRC) did a lot of innovative stuff regarding optimizations in that domain)
Re: Forth: The programming language that writes itself: The Web Page
#13A great introduction is the book Starting Forth [0]. It has the most charming illustrations I've ever seen in a text book. [0] https://www.forth.com/starting-forth/
[0] https://www.dnd.utwente.nl/~tim/colorforth/Leo-Brodie/thinki...
Re: Forth: The programming language that writes itself: The Web Page
#14Re: Forth: The programming language that writes itself: The Web Page
#15Since the post says you can discover Forth, here's my part:
https://github.com/loscoala/goforth
The main difference is that in this Forth variant, the source text is completely translated into bytecode and there is no runtime in the sense of classic Forth. This makes it easy to translate the bytecode to C.
I use my own Forth to generate C code with it, which I then embed in other software.
Re: Forth: The programming language that writes itself: The Web Page
#16anecdata (and warning some people might not like that domain brought here), there's a mini vm in bitcoin that a subset of forth https://en.bitcoin.it/wiki/Script I just learned that this week
It's a stack machine, but calling it a subset of Forth is maybe an exaggeration if you can't (afaik) define new words.
Re: Forth: The programming language that writes itself: The Web Page
#17Re: Forth: The programming language that writes itself: The Web Page
#18Re: Forth: The programming language that writes itself: The Web Page
#19Why did some ancient programming languages emphasize on CAPITAL LETTERS? Was there no "Shift" button on keyboards back then?
Re: Forth: The programming language that writes itself: The Web Page
#20Why did some ancient programming languages emphasize on CAPITAL LETTERS? Was there no "Shift" button on keyboards back then?