binodu
Every value is one bit, every bit lives in a named node, and a character is eight of them in a row.
asiekierka, 2011 · Turing complete: unknown · ●●○ moderate · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
asiekierka made binodu in August 2011. A program is a list of nodes. Each node holds one bit, can test other nodes, can take another node's bit as its own, and can fire other nodes, which runs them to the end before it goes on. There are no numbers. Output is bits too; every eight written bits, high bit first, make one character.
Read the story
Nodes marked Automatic run once every tick. Nothing else runs unless something fires it, so a program is a small circuit that a clock keeps poking.
The machine
| Line | Does |
|---|---|
Automatic Node a | Define node a; Automatic runs it every tick |
Default True | Start the bit at True instead of False |
Compare And Compare Or | Test the node names on the deeper lines, Not b for the opposite |
Action True Action False Action | Run the deeper lines when the test was true, false, or always |
Fire b | Run node b now, to its end |
Store c | Take the bit of c; True and False are nodes too |
Output Output b | Write its own bit or the bit of b |
Stop | Stop running automatically until something fires it |
Depth is indentation, so a Compare and its Actions can sit inside another Action. A node defined as Output Node prints name: True or name: False after every tick. The run ends when no Automatic node is left running.
Example
! is 00100001.
! is 00100001. Zeros writes two 0 bits, and Bang fires it three times around two 1 bits.
A node that flips its own bit. On the first tick it is False, so Action False stores True. On the second tick it is True, so it stores False and stops.
The Hello World and 99 bottles of beer programs both run. The 99 bottles program keeps its count in two decimal digits of four nodes each. A digit that goes from 0 to 9 fires the digit above it, as a borrow does in subtraction, and the program prints all 99 verses in 261,589 steps.
Patterns it teaches
- Encoding tricks: text written out one bit at a time.
Further
See also
Also in Strange time
Write your own in Run Convert a program from binodu
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: binodu.
Command line
shib run binodu program.txtThe program is long; save it as program.txt first.
shib manual binoduSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/binodu.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org