esolang

MiLambda

A two-dimensional language written in Greek. The program ends at λ.

2015 · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 3 known programs · Hello World on Try It Online: identical · Test method

Run it

Expected: 12345

The idea

MiLambda, μλ, is a grid of instructions that a pointer walks through, as in Befunge. Arrows steer it, and most other instructions are Greek letters. Δ and δ add and take one, Θ prints, λ halts. There are two numbers to work with, the cell and the store, and a memory whose addresses are those numbers.

Read the story

Decisions are made by turning. σ sends the pointer up when the cell differs from the store, Σ sends it down, and Z or ζ make it bounce straight back. A loop is a path that comes round to the same spot.

The machine

The pointer starts at the top left, heading right. It wraps around the edges of the grid.

InstructionDoes
> < ^ vHead right, left, up, down
Z ζBounce back if the cell is not 0; if it is 0
\| _Bounce back when moving sideways; when moving up or down
σ ΣHead up; head down, if the cell is not the store
Υ υHead left; head right, if the store is not 0
Δ δ E ε ςCell plus 1, minus 1, plus 10, minus 10, set to 0
Ξ ξ ' ` | Store becomes the cell; cell becomes the store; store plus 1, minus 1
s g P ρmemory[cell] = store; store = memory[cell]; memory[store] = cell; cell = memory[store]
Θ θ πPrint the cell as a character, as a number; read a character
λHalt

The specification also lists Ι and ι as redirections without saying where to; this implementation leaves them out.

Example

The first is the counting example from esolangs.org.
Expected: b

The first is the counting example from esolangs.org. Five ' make the store 5. Each time round, Δ adds one to the cell and θ prints it; while the cell is not yet 5, Σ sends the pointer down, < and ^ bring it back to >.

Further

Ideas it shows

Two-dimensional languages

Cell-based

Write your own in Run Convert a program from MiLambda

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: milambda.

Command line

shib run milambda -e 'πΔΘλ' --input 'a'
shib manual milambda

Source

Module
langs/tio/ports.js
Interpreter
langs/tio/milambda.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org