---
title: "lumen: Scripting language and VM in Kotlin | VulCode"
description: "lumen is a dynamically typed scripting language in Kotlin, compiled to bytecode and run on a stack-based virtual machine."
url: "https://vulcode.com/en/portfolio/other/lumen"
lang: "en"
---

[Other](https://vulcode.com/en/portfolio/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.

## 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

- A scanner that splits source code into tokens

- A parser that builds an AST

- A compiler that turns the AST into bytecode

- A stack-based virtual machine that executes the bytecode

- Dynamic typing of values

## Related projects

- [**facet** A framework for building web applications in Ruby that needs nothing installed on top: Ruby itself is enough. Its layout follows Rails: resources, controllers, views, migrations, background jobs and mail.](https://vulcode.com/en/portfolio/other/facet)

- [**bazaar** An online shop written in PHP on a hand-rolled microframework, with no Laravel or Symfony. It has a catalogue, a cart, Stripe Checkout payments, customer accounts and an admin back office.](https://vulcode.com/en/portfolio/other/bazaar)

- [**slotline** A booking system for rooms, courts and equipment built on Spring Boot. It makes sure the same slot does not go to two people, even when they book at the same moment.](https://vulcode.com/en/portfolio/other/slotline)

## Describe your project.

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

### Rather skip the form?

Ask in the chat or write to us directly.

Open the chat

- **Email**: [hello@vulcode.com](mailto:hello@vulcode.com)
- **Phone**: [+48 576 043 920](tel:+48576043920)
- **Discord**: [discord.gg/vulcode](https://discord.gg/vulcode)

## 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.

[Free quote](https://vulcode.com/en/quote) [Free consultation](https://vulcode.com/en/consultation)

- [hello@vulcode.com](mailto:hello@vulcode.com)

- [+48 576 043 920](tel:+48576043920)

- [discord.gg/vulcode](https://discord.gg/vulcode)
