Skip to content
tkernel
Français GitHub

Developers

Use the kernel in your program

tkernel-core is a Rust library with no dependency. You drive it with text commands (exec) and read its state as JSON (query). That's the whole contract.

Commands in, text out

use tkernel_core::Kernel;

let mut k = Kernel::new();
for line in ["input a", "output y", "pmos a vdd y", "nmos a y gnd", "set a 0", "settle"] {
    k.exec(line).unwrap();
}
assert!(k.exec("probe y").unwrap().contains('1'));

// as JSON, for a front
let state = k.exec_json("query state");
assert!(state.starts_with("{\"ok\":true"));

With the guided path, tools unlock as you build: tkernel_parcours::kernel() gives a kernel where clock stays locked until a latch passes its spec, and free on opens everything.

Your own front

A front has no logic of its own: it sends commands and shows what the kernel answers. Ids are stable, every edit can be undone, and the whole project saves as text. The contract is written in docs/FRONT.md: a terminal, a web page or a game can plug in without touching the kernel.

Share components

A package is a folder with a manifest and your components. Installing one replays only definition commands and checks the specs again, so a package can't do anything else.

paquet prepare my-gates NAND XOR nom=my-gates auteur=you
paquet installe my-gates prefixe=friend

The component library of this site is coming next: propose a package with a pull request, the CI replays it in the kernel.

Documentation

In the repository, in French for now.

DocumentWhat's inside
docs/book/the manual, from the pixel to the snake
KERNEL.mdthe kernel: commands, simulation, files
FRONT.mdthe contract between the kernel and a front
STACK.mdthe software staircase: platform, VM, translation, emulator
ASM.md, LANGAGE.mdthe configurable assembler, the TkL language
INVENTER.mdwhat is free (almost everything) and what is fixed
VISION.mdthe vision, the principles, the roadmap

Contribute

Issues and pull requests are welcome. The project is written in French (texts and comments); the rules of the code (short files, one command = one method, a kernel without dependency) are in CLAUDE.md.

cargo test --release              # kernel, guided path (and every manual example), command line
cargo test --release --workspace  # everything, workshop included