Troupe is a programming language based on the actor model for concurrent and distributed programming that provides dynamic information flow control.
Troupe consists of three main components:
- Compiler (
compiler/) — Haskell-based compiler that transforms Troupe code to JavaScript. - Runtime (
rt/) — TypeScript/JavaScript runtime implementing the actor model and information flow control. Thert/built/folder is the build target for generated code. - Standard library (
lib/) — built-in libraries written in Troupe.
- P2P tools (
p2p-tools/) — utilities for the distributed runtime, including a libp2p relay (p2p-tools/relay/). In multinode deployments the relay lets users communicate with Troupe nodes behind NAT.
| Path | Contents |
|---|---|
compiler/ |
Haskell compiler sources (troupec) |
rt/ |
TypeScript runtime; rt/built/ is the generated build output |
lib/ |
Troupe standard library (.trp sources); lib/out/ is the compiled output |
trp-rt/ |
Node service module (service.trp), loaded at startup; make trp-rt |
bin/ |
Compiled binaries — not version-controlled; do not add scripts here |
scripts/ |
Version-controlled executable scripts |
dev-utils/ |
Developer helper scripts (e.g. build-snapshot.sh) |
tests/ |
Test corpus (see docs/CONTRIBUTING.md) |
examples/ |
Example and benchmark programs (benchmarks/, savina/, variants/, …) |
p2p-tools/ |
P2P utilities and relay |
notebook/ |
Notebook front end and back end, built by make notebook |
docs/ |
Project documentation |
With all dependencies installed, build everything and run a program:
make all # npm install, then compiler, runtime, trp-rt, p2p-tools, libraries
./local.sh myprogram.trp # run a program locally (no P2P)all is the default goal, so a bare make builds the same set.
To try Troupe without a manual install, use the VSCode development container in the Troupe/example-project repository.
| Document | Contents |
|---|---|
| docs/INSTALL.md | Dependencies and step-by-step installation, including OS X setup |
| docs/DEVELOPMENT.md | Editor setup, build/test commands, running programs, source maps |
| docs/ARCHITECTURE.md | Compilation pipeline, runtime architecture, IFC, file extensions |
| docs/MODULES.md | Module system: imports and content-addressed identity |
| docs/FFI.md | Native modules: require native, manifests, host registries |
| docs/VARIANTS.md | Syntactic variants: datatype declarations and constructors |
| docs/OPERATORS.md | User-defined infix operators and fixity declarations |
| docs/CONTRIBUTING.md | Test-suite layout and how to add a built-in function |
| docs/NETWORKING.md | P2P runtime, libp2p, node discovery, relays |
| CONTRIBUTING.md | Pull-request policy and code style |
The current user guide is accessible here. A Jupyter-book version is also available. See docs/ARCHITECTURE.md for a note on DC label syntax.