Self-hosting milestone

Neo interprets Neo.

The repository now contains a complete Neo interpreter implemented in Neo. It includes its own lexer, parser, evaluator, runtime environment, file runner, and persistent multiline REPL.

Regression result

The language is running through itself.

The interpreter executes Neo's full regression suite through interpreted execution. The native compiler and the Neo interpreter can now be checked against the same language behavior.

Neo REPL
Neo REPL. Type :quit to exit.
> {var x 40}
40
> {+ x 2}
42
> {def square (value)
... {* value value}}
> {square 6}
36
Inside the interpreter

A second implementation of the language.

The compiler remains the fast path for native executables. The interpreter makes Neo's semantics executable in Neo source.

01

Lexer and parser

Tokenization and recursive-descent parsing are implemented in Neo.

02

Evaluator

AST evaluation, functions, closures, references, dictionaries, and bound methods.

03

Vector runtime

Vectorized arithmetic, comparison, logic, spread, matrices, statistics, and AI primitives.

04

Control flow

Three-way if, loops, frames, break, next, repeat, and higher-order functions.

05

Code as data

Heterogeneous data, executable code values, and the run bridge.

06

Persistent REPL

Run a file, keep its environment, and continue interactively.

Source of truth

The interpreter is ordinary Neo source.

src/interpreter.neo contains the implementation. Generated C++ is a build artifact and should not be edited by hand.