We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Matrixlang

From Esolang
Jump to navigation Jump to search
MatrixLang
Paradigm(s) imperative, structured
Designed by User:Frodothecat
Appeared in 2026
Computational class Turing complete
Major implementations Reference implementation (Python)
File extension(s) .rain

MatrixLang is an imperative, dynamically-typed language whose defining feature is that every program has two interchangeable faces: an ASCII face you type, and a face written in half-width katakana glyphs that a program running in The Matrix's style can be read in. Both are renderings of the same syntax tree, and the toolchain converts between them without loss — parse(render_glyph(t)) == parse(render_ascii(t)) == t for any tree t, verified by a property test over 300 generated programs in both faces.

The code shown on screen in The Matrix film has no grammar, no semantics, and nothing in it runs — it was mirrored half-width katakana scanned from an unrelated cookbook, chosen because it looked right on camera. MatrixLang does not attempt to reproduce that code. It invents a real, executable language that the film's aesthetic could plausibly have been standing in for: a program can be authored normally and then viewed — never edited — in the glyph face, the way the film's operators are shown reading a live system rather than writing it.

MatrixLang is not affiliated with, sponsored by, or endorsed by Warner Bros. Entertainment Inc. or any other rights holder connected to the film. The falling glyphs are ordinary Unicode half-width katakana (U+FF66–FF9D), not the film's own glyph designs.

Design

Keywords are drawn from the film's vocabulary where the film's concept and the language concept are the same thing — dejavu (while) is literally seeing the same thing happen again; redpill / bluepill (if / else) is the choice itself; jackout (return) is leaving the construct and coming back with something. Three logical operators — splice (and), fork (or), unplug (not) — are themed rather than translated, since the film has no equivalent concept for logical conjunction; this is stated directly in the language's own design records rather than left for a reader to notice.

The language has four types (integer, boolean, string, list), agents (functions) with closures, and no null — a value either exists or the name does not. There is no eval, no file or network access, and no route from a program into the host language; a .rain file cannot do anything beyond compute and print.

Computational class

MatrixLang is Turing complete: it has named mutable variables, arbitrary integer arithmetic, conditionals, unbounded loops (dejavu), and recursive agents with closures. A step counter stops a runaway loop after 200,000 statements by default; this is a configurable safety limit for the reference implementation, not a restriction on what the language can express — it can be raised or removed per run.

Hello, world! program

trace "wake up, Neo"

Output:

wake up, Neo

The same program in the glyph face:

ト "wake up, Neo"

Both faces parse to the same tree and produce the same output; either can be converted to the other losslessly by the reference implementation's render command.

Example: closures

An agent (function) defined inside another agent captures the scope where it was defined, not where it is called from — the same rule most languages with closures use, applied to a language whose whole premise is film vocabulary rather than conventional keywords.

agent adder(n)
  agent add(m)
    jackout n + m
  flatline
  jackout add
flatline
construct add5 = adder(5)
trace add5(37)

Output:

42

add5 still knows n was 5 long after adder returned.

External resources

  • Source repository — interpreter, REPL, CLI, and full test suite
  • Learning MatrixLang — a from-scratch tutorial covering every keyword, both faces, and closures
  • Technical overview — the interpreter's design, the two-face round-trip property, and the project's own record of bugs it shipped and how each was caught