News Score: Score the News, Sort the News, Rewrite the Headlines

Compiling a Forth

I was curious how Forth worked so I built a bytecode compiler and a VM for a Forth-like language, as well as some visualizations to show how it all works.You don't need to know anything about Forth to follow along, aside from the fact it's a stack-oriented language.Here's a small program that prints the number three.The number (3) is pushed to the data stack, and then the dot (.) pops it from the data stack and prints it.We'll need more Forth features than this to build interesting programs.Fort...

Read more at healeycodes.com

© News Score  score the news, sort the news, rewrite the headlines