Hacker News new | past | comments | ask | show | jobs | submit login

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




It's a stack machine, but calling it a subset of Forth is maybe an exaggeration if you can't (afaik) define new words.


fair point, they say "forth like", I pushed it too far


By that rule the JVM is a 'subset of FORTH'.


yeah apologies, I can't edit my comment now or I would


I got the gist of it though, and I think you do have a point: FORTH showed the power of stack machines (and the HP calculators of course did too) in a way that not much else did and I'm pretty sure that the ease with which you can bring one up to bootstrap a new environment is part of the reason why they were (and still are) more popular than many people realize for embedded stuff and first silicon of new and experimental CPUs. You can bootstrap to an interactive system in an afternoon in FORTH and some of the JVM instructions are definitely reminiscent of FORTH.

So it isn't all that farfetched to see the link between the Bitcoin embedded scripting language and the FORTH language, especially the stack section of the opcodes. I'd say they're of the same family, not necessarily a subset, and the lack of Turing completeness is of course a purposefully limiting factor.

Stackmachines are fascinating, incredibly simple and yet quite powerful. There are a couple of such concepts in computing (NAND gates on the hardware side, the Lambda function on the software side and FORTH as well as for/if/jsr/load/store, and even brainfuck (and ook!)) which all allow you to build just about anything. Each of them warrants study.


Stack machines are really interesting. And Forth also had creative ways to think about code.

I still need to read http://fpgacpu.ca/publications/Second-Generation_Stack_Compu... (amongst others)


A very interesting chip was the NOVIX: https://en.wikichip.org/wiki/novix/nc4016




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: