mini-announcement: I've decided to publish Yotta.
Yotta is a forth-like language with a very small core. In the beginning, all you can do is:
- emit machine code,
- emit machine code that emits machine code,
- define new words ... that emit machine code
With just those primitives we define an x86-64 assembler, and from there we use that assembler to define most of a forth.
Check it out: https://github.com/typeswitch-dev/yotta/
In Yotta there are only three primitives:
$XX emits the byte XX (in hex)
^XX emits machine code that emits XX
: A defines the word A
From there, the first thing we need to do is define semicolon (;) which emits the RET instruction. Semicolon is used to end word definitions. We use semicolon to end its own definition.
This is the preamble, the first bit of Yotta code that the Yotta interpreter/compiler runs. Besides semicolon, we're also defining line and block comments with \ and ( ).
In Yotta there are only three primitives:
$XX emits the byte XX (in hex)
^XX emits machine code that emits XX
: A defines the word A
From there, the first thing we need to do is define semicolon (;) which emits the RET instruction. Semicolon is used to end word definitions. We use semicolon to end its own definition.