- C 90.5%
- Shell 9.1%
- PowerShell 0.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
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
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
| .claude/skills/torbscript | ||
| .github | ||
| .vscode | ||
| benchmarks | ||
| compiler | ||
| docs | ||
| examples | ||
| runtime | ||
| std | ||
| tests | ||
| tools | ||
| .gitattributes | ||
| .gitignore | ||
| CLAUDE.md | ||
| CONCEPT.md | ||
| LICENSE | ||
| project.trb | ||
| README.md | ||
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.
- CONCEPT.md - the language
- docs/ARCHITECTURE.md - how it is implemented, and the state of it
- examples/tour - the language in thirteen files
| 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