1
0
Fork
You've already forked latte
0
Specialized embeddable scripting system with model checker integration
  • Rust 94.2%
  • C 3.2%
  • Latte 1%
  • JavaScript 0.9%
  • Promela 0.3%
  • Other 0.4%
yvt 891c954e61
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
feat(text_mcp): automatically create parent directories in save_game
2026年07月14日 09:54:29 +09:00
.cargo
crates feat(text_mcp): automatically create parent directories in save_game 2026年07月14日 09:54:29 +09:00
integration chore: set package.repository metadata field 2026年06月23日 09:12:15 +09:00
LICENSES doc: license latte_text* under 0BSD 2026年06月23日 09:10:21 +09:00
tests fix(mir::mir_lower): insert empty BB at entry 2026年06月17日 01:19:51 +09:00
.editorconfig
.gitignore
.woodpecker.yml chore: use REUSE to track licenses 2026年06月23日 09:10:17 +09:00
Cargo.lock refactor: replace fxhash with rustc-hash 2026年07月12日 14:13:20 +09:00
Cargo.toml refactor: replace fxhash with rustc-hash 2026年07月12日 14:13:20 +09:00
flake.lock chore(nix): nix flake update 2026年06月23日 09:40:39 +09:00
flake.nix chore(nix): add apps.latte-text-mcp to flake 2026年07月11日 15:17:42 +09:00
README.md doc(readme): mention latte_text_mcp 2026年07月11日 15:21:55 +09:00
REUSE.toml feat(text_mcp): init 2026年07月11日 15:17:41 +09:00
rust-toolchain.toml chore(rust-toolchain): switch to Rust 1.95.0 2026年06月23日 12:59:18 +09:00

Latte

Latte is an embeddable scripting system for narrative logic in games.

Features

  • A minimalist dynamically-typed language

    • Supported types: null, boolean, numbers, strings, arrays, and functions
  • Rust-inspired syntax

    • fn name () { ... }, if <expr> { ... }, the last expression in a block becomes the return value
    • Labels ('a: <stmt>) and goto 'a
    • Local variables (var foo;)
  • Global variables

    • static g_foo = <expr>; defines a global variable
    • Global variables can be (de)serialized
  • Reactive global variables ("bindings") and exports

    • let g_foo = <expr>; tracks dependencies and re-evaluates when input variables change
    • export.main = fn () { ... }; exports a function to be called by the host
  • Supports model checking via the SPIN model checker

    • A model checker checks for runtime errors (assertion failures, uninitialized variable uses, etc.) though an exhaustive or approximate search over all possible runtime choices.

Example

See crates/latte_text/examples/vending_machine/main.latte for an example.

Primary Crates

Runtime

The following crates are the main entry point for embedders:

  • latte_player : A virtual machine (VM) implementation for executing Latte scripts.

  • latte_spin : A virtual machine (VM) implementation for verifying Latte scripts using the SPIN model checker.

Compiler

The following crates can be used to build custom Latte compilers or tools:

  • latte_hir - High-level Intermediate Representation (HIR). Handles parsing of Latte source files and defines the AST and HIR data structures.

  • latte_mir - Mid-level Intermediate Representation (MIR). Defines the MIR data structures. Includes transformation passes (dead code elimination, simplification, SSA conversion) and analysis passes.

Example Game Engine

Note: latte_text* crates are example code and may be removed in part or in whole at any time without prior notice.

License

This work is licensed under the European Union Public License (EUPL) 1.2.

The example game engine crates (latte_text*) are dedicated to the public domain under the 0BSD license.