Other

lumen

Scripting language and VM in Kotlin

A scripting language with dynamic typing, implemented in Kotlin. It has its own bytecode compiler and its own virtual machine that executes that code.

lumen

About the project

lumen is a dynamically typed scripting language in Kotlin, compiled to bytecode and run on a stack-based virtual machine. Source code goes through four stages: a scanner splits it into tokens, a parser builds an AST from them (a tree describing program structure), a compiler turns the tree into bytecode, a sequence of simple instructions, and the virtual machine executes them, keeping intermediate values on a stack. Dynamic typing means the types of values are checked while the program runs.

The challenge

For a scripting language to actually run code, a parser alone is not enough: the program still has to be compiled to bytecode and then run on a virtual machine written specifically for this language.

What we did

  1. 01

    A scanner that splits source code into tokens

  2. 02

    A parser that builds an AST

  3. 03

    A compiler that turns the AST into bytecode

  4. 04

    A stack-based virtual machine that executes the bytecode

  5. 05

    Dynamic typing of values

Related projects

Describe your project.

A free quote comes back within an hour during working hours.

Tell us what you want to build.

A free quote comes back within an hour during working hours. You talk to the person who writes the code.