u/williamalexakis

Phase — a statically-typed bytecode-interpreted language in C, with an essay on implementation
▲ 55 r/teenagersbutcode+3 crossposts

Phase — a statically-typed bytecode-interpreted language in C, with an essay on implementation

Phase is a statically-typed bytecode-interpreted programming language written in ~4,800 lines of C with zero external dependencies. It features a 25-opcode stack-based VM, 21 error types with source-mapped diagnostics, 5 primitive types, and a standard interpreter pipeline (lexer, parser, type checker, bytecode generator, VM).

I also wrote a technical piece on how it works by following out("Hello world!") end-to-end through every stage.

Writing: williamalexakis.com/interpreter-in-c

Repo: github.com/williamalexakis/phase

u/williamalexakis — 1 day ago