Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

LumenLang is a lightweight, stack-based scripting language built from scratch in C++20. It ships with its own compiler, its own bytecode format, and its own virtual machine — nothing is borrowed or generated by a parser toolkit.

Lumen isn’t trying to be the next production language. It’s a teaching tool disguised as one: a small, readable playground for exploring how real language toolchains work under the hood, from tokenizing source text down to executing raw bytecode instructions on a stack machine.

println 'Hello, world!'

name = ''
print 'What`s your name? '
inputStr &name

greeting = 'Hello, ' .. name .. '!'
println greeting
Hello, world!
What`s your name? Ryan
Hello, Ryan!

What this book covers

  • Getting Started — building the lumen executable and running your first script.
  • Language Guide — every language feature: variables, operators, strings, conditionals, labels, and routines.
  • Examples — walkthroughs of the example programs shipped with the interpreter.
  • Architecture — how the compiler pipeline turns .lmn source into bytecode, and how the VM executes it.
  • Debugging & Tooling — the disassembler, debug symbols, and the interactive debugger.
  • Reference — the opcode table and built-in function list, for when you need the exact bytes.

Project goals

Lumen exists to explore, hands-on:

  • How programming languages work
  • Compiler design
  • Bytecode formats
  • Virtual machines
  • Debugging systems
  • Language tooling

The goal is to keep the language approachable while implementing the same fundamental ideas used by much larger language runtimes.

Try it online

Lumen is also available online as Lumen Playground — no installation needed.

Source & license

LumenLang is open source under the GPL-3.0 license. The source lives at github.com/spikest3r/LumenLang.