june / Multi-bit-stack VM
1 Lajky
0 Forky
1 Soubory
Naposledy aktivní 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 Lajky
0 Forky
1 Soubory
Naposledy aktivní 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 Lajky
0 Forky
1 Soubory
Naposledy aktivní 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] = {}; |
june / Simplest Nova
0 Lajky
0 Forky
2 Soubory
Naposledy aktivní 5 months 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 |
june / Comparisons
0 Lajky
0 Forky
1 Soubory
Naposledy aktivní 6 months ago
An extension to lib/rpn to support comparisons.
| 1 | |:@rpn: < :@rpn data:($a $b)| ⁝ @js ⁝ f('@rpn data', ""+(Number($a) < Number($b))); |
| 2 | |:@rpn: > :@rpn data:($a $b)| ⁝ @js ⁝ f('@rpn data', ""+(Number($a) > Number($b))); |
| 3 | |:@rpn: == :@rpn data:($a $b)| ⁝ @js ⁝ f('@rpn data', ""+(Number($a) == Number($b))); |
| 4 | |
| 5 | ||:@include: lib/rpn.nv |
june / Driver Assistance
0 Lajky
0 Forky
1 Soubory
Naposledy aktivní 3 months ago
A model of a driver assistance function.
| 1 | |# Model based off of https://web.archive.org/web/20251026043806/https://beza1e1.tuxen.de/tla-plus.html #| |
| 2 | |# Driving Assist #| |
| 3 | :author: "June Gardner" |
| 4 | |
| 5 | |:state: off :seatbelt: unknown| :state: fault |
| 6 | |:state: off :sensors: broken | :state: fault |
| 7 | |:state: off :brakes: broken | :state: fault |
| 8 | |
| 9 | |:state: off :seatbelt: off | :state: temporary fault |
| 10 | |:state: off :sensors: blind| :state: temporary fault |
june / Fridge Simulation
0 Lajky
0 Forky
1 Soubory
Naposledy aktivní 6 months ago
Putting groceries away in the fridge.
| 1 | ||:@include: lib/rpn.nv |
| 2 | |
| 3 | |:groceries: $item| |
| 4 | :: put $item in the fridge |
| 5 | |
| 6 | |:: put $item in the fridge :fridge: $item $quantity?| |
| 7 | :: put $item in its bin |
| 8 | :: close all the bins |
| 9 | |:: put $item in the fridge? :fridge: $other $quantity| |
| 10 | :checked bins: $other $quantity |
june / Command Parser
0 Lajky
0 Forky
1 Soubory
Naposledy aktivní 6 months ago
A simple command parser.
| 1 | |:: read a line? :@stdio: (10 $x)| |
| 2 | :@stdio: 10 |
| 3 | :buffer: $x |
| 4 | |:: read a line :@stdio: 10| |
| 5 | |:: read a line?| |
| 6 | :@stdio: read |
| 7 | |
| 8 | |:: print the buffer? :buffer: $x| |
| 9 | :@stdio: write $x |
| 10 | |:: print the buffer| |