The TorbScript language: compiler, runtime, standard library and toolchain https://torb.dev
  • C 90.5%
  • Shell 9.1%
  • PowerShell 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Torben Köhn 487a7fdd75
Some checks failed
ci / what the change touches (push) Successful in 2s
ci / commit messages (push) Successful in 2s
ci / gates (push) Blocked by required conditions
ci / bootstrap and conformance (linux-arm64) (push) Waiting to run
ci / bootstrap and conformance (macos-arm64) (push) Waiting to run
ci / bootstrap and conformance (windows-x64) (push) Waiting to run
ci / every target emits the same C (push) Blocked by required conditions
ci / archives (push) Blocked by required conditions
ci / bootstrap (linux-x64) (push) Failing after 6s
ci / tier A (linux-x64) (push) Has been skipped
ci / tier B (linux-x64) (push) Has been skipped
ci / pack the seed (push) Failing after 3s
chore: remove the empty Avatar.image that an early test left in the root
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 14:33:55 +02:00
.claude/skills/torbscript docs(std/binary): the design record, the package page, and what the migration measured 2026-09-27 13:08:32 +02:00
.github ci(release): build, push and sign the root server's images on GHCR from every release 2026-09-27 11:01:25 +02:00
.vscode feat(checker)!: a field is written only with =, never by a command 2026-09-26 01:38:40 +02:00
benchmarks test(benchmarks): binary formats, to measure the standard library against itself 2026-09-27 13:08:32 +02:00
compiler feat(packages): publish to a registry on the network, with a token or trusted publishing 2026-09-27 11:01:25 +02:00
docs docs(std/binary): the design record, the package page, and what the migration measured 2026-09-27 13:08:32 +02:00
examples refactor(format): format the repository with torb format 2026-09-27 04:02:15 +02:00
runtime chore(runtime): regenerate the VM's natives table, and format dns-over-tls after the landing 2026-09-27 04:42:06 +02:00
std refactor(std): write Self in the From conversions, and label the compressed option of names 2026-09-27 13:08:32 +02:00
tests chore(runtime): regenerate the VM's natives table, and format dns-over-tls after the landing 2026-09-27 04:42:06 +02:00
tools build(deploy): compose.yml of GHCR images behind the owner's Traefik, with backups 2026-09-27 11:01:25 +02:00
.gitattributes build: check every file out as the repository holds it, without line ending conversion 2026-09-26 03:59:35 +02:00
.gitignore docs: make destructors, cancellation and the closure rule precise 2026-09-22 20:18:28 +02:00
CLAUDE.md build(tools): gate on format --check instead of canon --check 2026-09-27 04:02:15 +02:00
CONCEPT.md docs(tooling): torb format and torb lint are built, torb canon is deprecated 2026-09-27 04:02:15 +02:00
LICENSE chore: keep mbedTLS's own license outside the runtime's MIT-0 2026-09-24 23:36:24 +02:00
project.trb feat(checker)!: a field is written only with =, never by a command 2026-09-26 01:38:40 +02:00
README.md docs(release): the slogan One language, every layer, and the category a single-language ecosystem 2026-09-26 23:09:21 +02:00

TorbScript

One language, every layer. A single-language ecosystem.

A functional-first, multi-paradigm scripting language with value semantics. It runs interpreted and compiles to native executables, and it is its own configuration format.

Directory Contains
compiler/ The toolchain, written in TorbScript
std/ The standard library, one package per directory (std/core, std/fs, ...; std/prelude re-exports)
runtime/ The C runtime every compiled binary links against (runtime/README.md)
examples/ Tour and example projects
tests/ The conformance suite and the language smoke programs (tests/conformance/README.md)

Building

The compiler is written in TorbScript and compiles itself, so a checkout needs two things: a C compiler ($TORB_CC, or clang, gcc, cc in that order) and a seed - a torb that already exists. The seed is not in git, because it is a build artifact of an earlier commit rather than a fact about this one.

seed/torb[.exe]     a binary for this platform: a release download, or one built by a `torb` you already have
seed/program.c      the portable seed: the compiler as one C file, which builds anywhere a C compiler does

Put one of the two in place and build:

sh tools/bootstrap.sh          # seed -> build/bootstrap/torb -> build/release/torb

Two steps and not one: the seed compiles the current sources, that binary compiles them again, and the two program.c are compared byte for byte. build/release/torb is the compiler that comes out.

A release publishes both artifacts, so a checkout downloads the binary for its platform, or program.c for a platform that has none. Between releases the seed is whatever torb was built last:

torb build ./compiler --output ./seed/torb           # a binary seed for this platform
torb build ./compiler --emit-c --output ./seed/torb  # seed/program.c, the portable one

Once build/release/torb is there:

sh tools/gates.sh a            # the gates of every round (compiler/CONTRIBUTING.md)
sh runtime/build.sh            # the C runtime and its own tests