notes
notes copied to clipboard
Flop - An adapted Nock machine
Looking at the Nock spec there might be some interesting changes to be made:
- tree addressing (Nock uses infix numbering)
- infix [a [0 b]] to prefix [0 [a b]] operators
Is it one of these Ax machines? Nope.
The Nock combinator interpreter is interesting because it's essentially a form of Lisp, where the s-expressions are more or less explicit binary trees. It has no types, its atoms are unsigned integers which can be concatenated to pairs. These are called nouns.
Nock does not support floating point math or other advanced operations, in fact, anything more complex than integer addition typically introduces (or may introduce) sources of nondeterminism, which this language explicitly avoids.
Building an operating system on top of this is ambitious, but at least it's not Zot. That would be crazy. Or would it?
On the topic of esolangs, have a look at: https://esolangs.org/wiki/BitBitJump https://esolangs.org/wiki////
Nock has
- only acyclic code/data structure (nice for inner (DAG modification) and outer (VM jets) optimisation)
- inner determinism (evaluation results are fully defined)
- no pre-runtime determinism:
Given only the operators - or even the entire computation graph - it is not possible to estimate the runtime, as atoms may become arbitrarily large. This makes metering more difficult, as results and therefore atom sizes are only available after evaluation. This is true for any other virtual machine as well, due to turing completeness, however, in these other architectures, operations only take constant time.
Recursion: operation # estimation