Toolchain
Jda ships a unified CLI with 13+ subcommands covering the full development lifecycle.
CLI Commands
| Tool | Command | Description |
|---|---|---|
| Compiler | jda build / jda run | Compile and run .jda files |
| Formatter | jda fmt | Format source code |
| Test runner | jda test | Run conformance tests |
| Benchmarker | jda bench | Benchmark fn bench_* functions |
| Doc generator | jda doc | Generate HTML/Markdown docs |
| Package manager | jda pkg | Install, search, manage packages |
| Fuzzer | jda fuzz | Fuzz test fn fuzz_* functions |
| Race detector | jda race | Detect data races on globals |
| LSP server | jda-lsp | Language Server Protocol for editors |
| REPL | jda repl | Interactive read-eval-print loop |
| WASM | jda wasm | Compile to WebAssembly |
| ARM64 | jda arm64 | Cross-compile to ARM64 |
Package Manager
jda pkg init # create jda.toml manifest
jda pkg add <name> <url> [tag] # add git dependency
jda pkg remove <name> # remove dependency
jda pkg install <name> # install stdlib package to lib/
jda pkg list # list installed packages
jda pkg search [query] # search stdlib packages
jda pkg tree # show dependency tree
jda pkg build # resolve deps and compile
jda pkg run # build and executeManifest (jda.toml)
[package]
name = "myapp"
version = "0.1.0"
[build]
entry = "src/main.jda"
output = "build/myapp"
[dependencies]
mylib = { git = "https://github.com/user/mylib", tag = "v1.0" }Documentation Generator
Doc comments use ;; prefix:
;; Calculate the distance between two points.
;; Returns the squared Euclidean distance.
fn distance(a: &Point, b: &Point) -> i64 {
let dx = b.x - a.x
let dy = b.y - a.y
ret dx * dx + dy * dy
}Generate docs:
jda doc stdlib/ # HTML docs for all stdlib files
jda doc --output docs/ src/ # specify output directory
jda doc --json file.jda # JSON output for toolingTesting
Conformance tests use .jda + .expected pairs:
tests/my_test.jda
tests/my_test.expectedThe test runner compiles each .jda file, runs it, and compares stdout against .expected:
jda test tests/Benchmarking
Write benchmark functions prefixed with bench_:
fn bench_fib(n: i64) {
let i = 0
loop i < n { fib(25) i = i + 1 }
}Run:
jda bench mylib.jda # auto-calibrate iterations
jda bench --count 1000 mylib.jda # fixed iteration count
jda bench --json mylib.jda # JSON output
jda bench --compare base.json mylib.jda # compare against baselineOutput (Go-style):
bench_fib 1000 12345 ns/opFuzzing
Write fuzz targets prefixed with fuzz_:
fn fuzz_parser(data: &i8, len: i64) {
parse(data, len)
}jda fuzz mylib.jdaRace Detection
Detects data races in concurrent programs using epoch-based happens-before analysis:
jda race myapp.jdaFormatter
jda fmt myfile.jda # format in place
jda fmt --check myfile.jda # check without modifyingVS Code Extension
Syntax highlighting, LSP integration, and snippets for .jda files:
cd tools/vscode-jda && code --install-extension .Features: syntax highlighting, bracket matching, auto-indent, comment toggling, LSP hover/diagnostics/completion, and code snippets (fn, struct, impl, for, match).
Version Manager (jdavm)
Install and switch between multiple Jda versions:
curl -fsSL https://raw.githubusercontent.com/jdalang/jda-lang/main/install-jdavm.sh | sh
jdavm install latest
jdavm install 0.1.1
jdavm use 1.0.0
jdavm list