june / Bin-stack Compiler
0 likes
0 forks
4 files
Last active 2 weeks ago
A compiler from a multi-bit-stack VM to C.
| 1 | |:: read a character :@stdio: read| |
| 2 | :end of file: |
| 3 | |:: read a character :@stdio: $x| |
| 4 | :buffer: $x |
| 5 | |:: read a character?| |
| 6 | :@stdio: read |
| 7 | |
| 8 | |:: reverse? :buffer: $x| |
| 9 | :text: $x |
| 10 | |:: reverse| |
june / Graph Traversal
0 likes
0 forks
1 files
Last active 2 weeks ago
A basic graph traversal algorithm.
| 1 | ||::( |
| 2 | A - B - C |
| 3 | |
| 4 | check if C is connected to A |
| 5 | ) |
| 6 | |
| 7 | |:: ($A - $B - $C)| |
| 8 | :: ($A -> $B -> $C -> $B -> $A) |
| 9 | |:: ($A - $B)| |
| 10 | :: ($A -> $B -> $A) |
june / Multi-bit-stack VM
0 likes
0 forks
1 files
Last active 2 weeks 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 |
Newer
Older