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, references, conditionals, labels, routines, and the standard library (files, random, HTTP, capabilities).
  • Examples — walkthroughs of the example programs shipped with the interpreter.
  • Lumen in apps — Lumen embedded as a scripting layer inside other software, including a mobile runtime for Android.
  • Platforms & Ports — how the same VM runs on Raspberry Pi Pico, AVR, and in the browser via WebAssembly.
  • 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.

Beyond the desktop

The lumen CLI you’ll build in Getting Started is the full toolchain, but the VM it’s built around also runs on Raspberry Pi Pico, AVR microcontrollers, and — via the same WebAssembly build that powers the Playground — in the browser, where compiled programs can be exported as QR codes and scanned straight into Lumen on Android. See Platforms & Ports for the full picture.

Source & license

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