Terminatermina

A language for real-time
critical systems

Deterministic. Analyzable. Memory-safe by construction.

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 null-pointer dereferences and leaks. Every array access is checked, at compile time where the transpiler can prove it and at run time otherwise.

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) {
 9
10    self->hk_subsystem_port.update_params();
11    self->hk_subsystem_port.do_housekeeping();
12    return;
13
14  }
15
16};
Toolchain

From a new project to a board

The transpiler builds a project, runs its tests on the host and on the boards, and fetches its dependencies. It comes as native binaries for Linux and macOS, and inside a container image that also carries the OSAL and the SPARC, Arm and RISC-V cross-toolchains of the supported platforms.

docker-termina

The development image, published on GHCR, with the transpiler, the OSAL and the cross-toolchains of every supported platform. Pin an exact version tag, such as v0.7.0, to give a course or a project a reproducible setup.

VS Code extension

Syntax highlighting and a language server for .fin files, a command that creates a project, the tests of a project in the Testing view, and debugging on the host and on the boards. Published on the Marketplace as termina-lang.termina, it works inside the container through Dev Containers.

The Termina Book

Installation, a guided tutorial, the language chapter by chapter, the reactive model, memory, device drivers, testing, the package manager and the supported platforms. 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.