Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Guide

Languages / 言語: English · 日本語 — the Japanese edition is a complete machine-assisted translation under review; corrections are welcome. 日本語版は機械翻訳を基にした全訳で、レビューを進めています。修正のご提案を歓迎します。

Navigation: Documentation Root

Onboarding-oriented documentation for new users and embedders. Where the architecture, spec, and reference sections describe what Keleusma is, this section describes how to use it.

You can try Keleusma in your browser at the playground: it compiles and verifies your program with the compiler running as WebAssembly and reports its worst-case execution-time and memory bounds live, no installation required.

The guide is in two layers. The first is a linear course of forty chapters that teaches Keleusma from scratch, sized for video presentation and ordered as a single learning arc. The second is a set of reference pages for lookup and deeper study. The course and the reference pages overlap by design: the course is for first learning, the reference pages are for going back.

The Course

Forty chapters in ten parts. Each chapter is self-contained and demo-driven, sized to roughly one short video. Parts I through VIII teach the language; Part IX teaches embedding into a Rust host; Part X points onward.

Part I — Setting Out

Part II — The Building Blocks

Part III — Shaping Data

Part IV — The Heart of Keleusma

Part V — The Verifier and the Guarantees

Part VI — Going Deeper

Part VII — Shipping a Program

Part VIII — The Capstone: Making Music

Part IX — Embedding Keleusma in a Rust Program

Part X — Where to Go Next

ChapterTitle
40Further Reading

Reference Pages

The reference pages are the topic-organized companions to the linear course. Each is a self-contained document that the corresponding course chapters draw on and that a reader returns to when looking up a specific question.

DocumentAudiencePurpose
GETTING_STARTED.mdFirst-time userInstall the CLI, write a first script, run it, embed it in a twenty-line Rust host. Course coverage: Chapter 2, Chapter 31.
EMBEDDING.mdRust host authorThe complete host-facing reference: Vm construction, native function registration, arena sizing, the call and resume protocol, error recovery, opaque host types, the Library trait, signed modules. Course coverage: Part IX (Chapters 31 through 39).
PIANO_ROLL.mdSong author, host lifter, or host architectThe long-form manual for the piano-roll example: composing songs, lifting the host loop into another application, and using the example as an architectural reference for other control-loop domains. Course coverage: Part VIII (Chapters 27 through 30).
ROGUE.mdGame author or host architectThe long-form manual for the roguelike example: gameplay rules, the host and multi-script architecture, dungeon generation, the artificial-intelligence archetypes, item effects, and exercises. Not covered by a chapter; pointed to from Chapter 40.
WHY_REJECTED.mdAnyone whose program failed verificationThe full catalogue of verifier rejection messages, mapped to root causes and proposed rewrites. Course coverage: Chapter 19 introduces the three most common rejections; this document is the full list.
FAQ.mdAnyone who hit a surpriseCommon rough edges in V0.2.0, including string handling, escape sequences, the immutable-locals constraint, and migration notes from the V0.1.x line.
COOKBOOK.mdEmbedder reaching for a known-good patternWorking recipes for embedding patterns: the data-loader pattern, auto-sizing the arena from a module’s WCMU, narrow-runtime type aliasing, signed bytecode distribution, calibrated WCET with a measured cost model. Course coverage: Chapter 39 names the patterns; this document is the recipes.
BIG_NUMBERS.mdAuthor needing multi-digit arithmeticThe full worked example for the overflow construct: 64-by-64 to 128-bit multiplication via the high half, and addition with explicit carry-out propagation for chained multi-digit arithmetic. Course coverage: Chapter 23 introduces the construct; this document is the full technique.
LLM_USAGE.mdOperator using AI coding assistantsPatterns AI tools tend to get wrong, the read-AGENTS-first session protocol, prompt patterns that reduce iteration time.
AUTOMATION_SCRIPTING.mdOperator writing devops or sysadmin automation in KeleusmaThe consolidated CLI scripting story: the three ways to run a script, script arguments, the entry kinds mapped to one-shot, staged, and daemon deployment shapes, the shell bundle as an orchestrator, signed and encrypted bytecode distribution, the run-tasks multi-script runner, and where the static guarantees do not hold. Ties together Chapters 2, 15 through 18, 25, and 26 with the operator reference docs.
SECURITY_POLICY.mdOperator deploying keleusma-cli in constrained environmentsThe strict-mode signing and encryption policies introduced in V0.2.1: key generation, policy activation, deployment scenarios, the trust model, daemon deployments and tick-interval cadences.
METRICS.mdOperator planning embedded or constrained deploymentsBinary size, RSS, peak memory footprint, CPU cycles, comparison to bash, Lua, Python, Ruby, and Node.js. Includes steady-state daemon footprint under the tick-interval rate limiter.
SHELL_AUDIT.mdOperator evaluating whether stddsl::Shell is rich enough for a planned daemonPresent capabilities of the bundle, closed gaps, and open recommendations for V0.2.x point releases.

Companion Material

PathContent
examples/scripts/Standalone .kel files demonstrating language features. Run any of them with keleusma run examples/scripts/<file>.kel.
examples/Rust embedding examples. Run with cargo run --example <name>.
examples/piano_roll.rsEnd-to-end SDL3 audio host with hot code swap across a song roster. Run with cargo run --release --example piano_roll --features sdl3-example.
examples/rogue/End-to-end SDL3 video host driving a roguelike. Run with cargo run --release --example rogue --features sdl3-example.
keleusma-cli/The standalone command-line frontend installed by cargo install --path keleusma-cli --bin keleusma.

When a term is unfamiliar:

  • GLOSSARY.md defines core terms.
  • LANGUAGE_DESIGN.md describes the function categories, the five guarantees, and the conservative- verification stance.
  • GRAMMAR.md is the formal syntax reference.
  • TYPE_SYSTEM.md describes primitive types, string discipline, and composite types.
  • STANDARD_LIBRARY.md lists the bundled native functions in the audio:: and math:: namespaces.

Planning Document

OUTLINE.md is the planning document the course was drafted against. It records the pedagogical decisions, the music-to- Keleusma concept map, and the open questions still under review. It is working material rather than user-facing documentation.