Lyn

A small, typed language for games and microcontrollers.

Readable like a scripting language, predictable like a systems one.

Lyn is in early development. It's closed and invite-only for now, and will become open source once it is bootstrapped, meaning once Lyn is compiled by a compiler written in Lyn. Until then it's a proof of concept: a hobby project and a recreational language.

What is Lyn?

Lyn is a statically typed language that runs on a small virtual machine written in portable C. The same script can drive a game, run as a mod inside someone else's program, or control a microcontroller with a few kilobytes of RAM.

import "std.math"

enum Vent {
    closed
    open(fixed)
}

struct Greenhouse {
    name: string
    temp: fixed = 21.0
    vent: Vent = Vent.closed
}

fn update(g: Greenhouse) {
    if g.temp > 28.0 {
        g.vent = Vent.open(math.clamp(g.temp - 28.0, 0.0, 1.0))
    }
    print("{g.name}: {g.temp}°C, vent {g.vent}")
}

east = Greenhouse{ name: "east", temp: 28.5 }
update(east)    // east: 28.5°C, vent open(0.5)

What Lyn offers

The language

Memory and runtime

On the way

Following along

Progress is written up in the devlog, and small programs end up in the showcase. If you'd like to try Lyn early, write to hello@lynlang.org.