june / Bin-stack Compiler
0 喜歡
0 分支
4 檔案
最後活躍 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 / Multi-bit-stack VM
0 喜歡
0 分支
1 檔案
最後活躍 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 |
june / Simplest Nova (C++)
0 喜歡
0 分支
1 檔案
最後活躍 3 weeks 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] = {}; |
june / Simplest Nova
0 喜歡
0 分支
2 檔案
最後活躍 3 weeks ago
The simplest Nova implementation I've got (so far).
| 1 | #!/usr/bin/env python3 |
| 2 | |
| 3 | import sys |
| 4 | from enum import Enum |
| 5 | |
| 6 | class State(Enum): |
| 7 | # States |
| 8 | INSERT = 0 |
| 9 | MATCH = 1 |
| 10 | REMOVE = 2 |
上一頁
下一頁