Toolchain

Jda ships a unified CLI with 13+ subcommands covering the full development lifecycle.

CLI Commands

ToolCommandDescription
Compilerjda build / jda runCompile and run .jda files
Formatterjda fmtFormat source code
Test runnerjda testRun conformance tests
Benchmarkerjda benchBenchmark fn bench_* functions
Doc generatorjda docGenerate HTML/Markdown docs
Package managerjda pkgInstall, search, manage packages
Fuzzerjda fuzzFuzz test fn fuzz_* functions
Race detectorjda raceDetect data races on globals
LSP serverjda-lspLanguage Server Protocol for editors
REPLjda replInteractive read-eval-print loop
WASMjda wasmCompile to WebAssembly
ARM64jda arm64Cross-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 execute

Manifest (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 tooling

Testing

Conformance tests use .jda + .expected pairs:

tests/my_test.jda
tests/my_test.expected

The 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 baseline

Output (Go-style):

bench_fib       1000    12345 ns/op

Fuzzing

Write fuzz targets prefixed with fuzz_:

fn fuzz_parser(data: &i8, len: i64) {
    parse(data, len)
}
jda fuzz mylib.jda

Race Detection

Detects data races in concurrent programs using epoch-based happens-before analysis:

jda race myapp.jda

Formatter

jda fmt myfile.jda          # format in place
jda fmt --check myfile.jda  # check without modifying

VS 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