june / Multi-bit-stack VM
1 mi piace
0 forks
1 files
Ultima volta attivo 5 months ago
A sketch of a small virtual machine that operates on multiple stacks of bits.
| 1 | ||:: dispatch |
| 2 | |
| 3 | |:: dispatch| :: evaluate :text: " |
| 4 | initial state |
| 5 | 01 11 11 11 |
| 6 | rules |
| 7 | rule |
| 8 | and if |
| 9 | 1 match |
| 10 | else |
june / Stacky Tape VM
0 mi piace
0 forks
1 files
Ultima volta attivo 5 months ago
A VM with a tape of stacks.
| 1 | |:: push to $x :value: $y| :stacks: $x $y |
| 2 | |:: push $x to $y| :stacks: $y $x |
| 3 | |
| 4 | |:: pop from $x :stacks: $x $y| |
| 5 | :value: $y |
| 6 | :: reset stacks |
| 7 | |:: pop from $x? :stacks: $z $y| |
| 8 | :seen: $z $y |
| 9 | |:: pop from $x :default symbol: $y?| |
| 10 | :value: $y |
june / Simplest Nova (C++)
0 mi piace
0 forks
1 files
Ultima volta attivo 5 months ago
The simplest Nova implementation I've got (so far) in C++.
| 1 | enum snv_state { |
| 2 | // Primary states. |
| 3 | INSERT, MATCH, REMOVE, |
| 4 | // Secondary states. |
| 5 | FETCH, LITERAL, VARIABLE |
| 6 | }; |
| 7 | |
| 8 | template<uint32_t size> |
| 9 | struct snv_stack { |
| 10 | uint32_t data[size] = {}; |