june / Bin-stack Compiler
0 beğeniler
0 çatallar
4 dosyalar
Son aktivite 3 months 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 beğeniler
0 çatallar
1 dosyalar
Son aktivite 3 months 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
1 beğeniler
0 çatallar
1 dosyalar
Son aktivite 3 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 beğeniler
0 çatallar
1 dosyalar
Son aktivite 3 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 |