Terminatermina

A language for real-time
critical systems

Deterministic. Analyzable. Memory-safe by construction.

$ docker pull ghcr.io/termina-lang/docker-termina:latest copy
Why Termina

Core principles

Termina simplifies the implementation of critical real-time software and reduces the cost of validating and verifying it.

Ease of learning and use

An imperative language with a C-like syntax, so developers can adopt it without learning a new paradigm.

Domain-specific abstractions

Events, tasks, and asynchronous handlers are constructs of the language, used directly to build the application.

Reactive programming model

Tasks and handlers are reactive entities. Global events are bound to their actions, which helps analyze and verify the application.

Run-to-completion semantics

Every action finishes once started, without blocking its task. All functions terminate, with bounded loops and no recursion.

Safe interaction patterns

Entities interact through only two mechanisms: shared resources and asynchronous messages. Shared resources are guarded by monitors.

Deterministic and memory-safe

Dynamic memory comes only from fixed-size pools, and the type system rules out access errors, null-pointer dereferences, and leaks.

The language

Reactive entities and passive resources

An application is organized around three kinds of stateful entity, connected through typed ports. Tasks and handlers are reactive: their actions respond to events raised by emitters (periodic timers, interrupts, system start-up). Resources are passive, encapsulating data that the rest of the system uses.

  • Tasks. Reactive entities with their own thread, priority, and stack size; their actions run to completion.
  • Handlers. Reactive entities with no execution context of their own; a single action gives a low-latency response and delegates the rest to tasks.
  • Resources. Passive entities that encapsulate data and expose it through interfaces; the transpiler makes concurrent access mutually exclusive.
housekeeping.fintermina
 1// The housekeeping task of the tutorial
 2task class CHKTask {
 3
 4  hk_subsystem_port : access IHKSubsystem;
 5
 6  timer : sink TimeVal triggers hk_timeout;
 7
 8  action hk_timeout(&priv self, _t : TimeVal) -> Status<i32> {
 9    let status : Status<i32> = Success;
10    self->update_params();
11    self->do_housekeeping();
12    return status;
13  }
14
15};
Toolchain

One container, ready to build

The toolchain is a Docker image, an editor extension, and a book. The image bundles the transpiler, the OSAL, and the SPARC and Arm cross-toolchains, so a working environment is one docker pull away.

docker-termina

The development image, published on GHCR. Pin an exact version tag, such as v0.4.0, to give a course or a project a reproducible setup.

VS Code extension

Syntax highlighting and a language server for .fin files, published on the Marketplace as termina-lang.termina. Works inside the container through Dev Containers.

The Termina Book

Installation, a guided tutorial, the language chapter by chapter, the reactive model, memory, and device drivers. Every C fragment shown is real transpiler output.

Termina

Start with the book

It takes a first program from an empty directory to a running system, then covers the language end to end against the current release.