Skip to main content

Building Worlds with Words: Introducing Lyminale

2025-11-27

For as long as I can remember, I’ve been obsessed with languages—both programming and natural.
There’s something magical about using words and structure to model ideas, worlds, and interactions. In my previous post, I introduced a small expression language. This time, I wanted to go much further.

I wanted to design a language that feels like describing a world, not programming one.

That became Lyminale.

Lyminale is an experimental language and engine built around three core ideas:

1. Declarative by design

Write what should happen, not how.
The syntax is intentionally simple—friendly enough for non-programmers, expressive enough for complex systems. In fact, the grammar is so minimal and regular that modern LLMs can generate correct Lyminale programs without ever being trained on the language at all.

2. Pattern matching everywhere

Instead of deeply nested if/else chains, Lyminale lets you describe events as patterns.
If the user says something similar to your trigger, the engine knows what you meant.

3. Semantics and reactivity built in

Objects hold state.
Scenes define behavior.
Decorators attach reactive listeners to objects, enabling logic that fires automatically when state changes—no boilerplate.


Not Just for Games

Although Lyminale was inspired by interactive fiction and text-based RPGs, the language is broadly useful anywhere you need to describe stateful, reactive systems using plain language:

  • Narrative engines
  • Prototyping assistants
  • Interactive chat-driven applications
  • Workflow / automation prototypes
  • Simulation logic
  • Data-driven state machines

If your problem can be described as “objects with state + logic that reacts to changes,” Lyminale fits.


What You Can Build With It

Games are just one application. But they’re a great way to show what the language can do.

With Lyminale, a scene can define what happens when the player looks around, attacks an enemy, picks up an item, enters another area, or just says something ambiguous.

Objects describe your world; scenes describe the experience within it.

For example, you can declare:

  • Enemies with health and loot
  • A world with gold, flags, and conditions
  • Player stats and inventory
  • Scenes with semantic triggers like "enter north" | "go north" | "go to forest"

The language handles:

  • Matching patterns like "attack wolf" or even "hit the wolf"
  • Reacting to state changes (e.g., health dropping below 20)
  • Calling functions to manage combat, healing, or inventory
  • Entering scenes and running their logic
  • Listening to semantic commands, not exact strings

A Note on Performance: Tiny Footprint, Serious Optimizations

Lyminale’s engine includes an optimized embedding pipeline that I personally hand-tuned and quantized.
It runs the entire semantic matching system—including vector embeddings—on a 0.1 CPU instance with only 256MB RAM and 2GB of disk.

This was made possible through:

  • quantization of the embedding model
  • specialized loading routines
  • small-footprint inference

The result: semantic command matching that runs essentially anywhere.


Here’s a Taste of Lyminale

Below is an example of a full Lyminale program:
a small text adventure with enemies, treasure, shops, combat, reactive decorators, scene transitions, and world logic.

It includes:

  • Decorators for reusable behaviors (e.g., making things mortal)
  • Objects with reactive listeners
  • Functions for common actions like healing, spending gold, or attacking
  • Scenes for the Crossroads, Forest, Village, and Deep Woods
  • Semantic triggers like "go north" | "go to forest clearing"

This program demonstrates how Lyminale turns game logic into something that reads like world-building.

(Full example program shown below.)


Try Lyminale Yourself

You can experiment with the language, build your own scenes, or run the example game directly in your browser:

👉 Play with Lyminale here:
Lyminale App

Whether you're building a game, designing a narrative engine, or just exploring new syntax, I hope Lyminale sparks the same joy in you that designing it sparked in me.

Happy coding—and happy world-building.