Skip to content

Latest commit

 

History

History
446 lines (337 loc) · 17.6 KB

File metadata and controls

446 lines (337 loc) · 17.6 KB

Jda Programming Language

Jda

A high-performance systems language with built-in concurrency and ML — without GC.
Bootstrapped from raw x86-64 assembly. The compiler compiles itself.

WebsiteInstallDocsStdlibBenchmarksComplex BenchmarksExamplesContributing


Highlights

  • Self-hosted — the compiler is written entirely in Jda (zero C/C++/Rust)
  • Bootstrapped from assembly — no external compiler dependency
  • 33x faster compilation than Rust — 42ms average compile time (benchmarks)
  • Beats C on sudoku and LZ77 — 41ms vs 62ms (sudoku), 277ms vs 1830ms (LZ77) — even running via Rosetta 2 x86-64
  • 6.6× faster than C on LZ77 — hash-chain compression with source-level optimizations outperforms all languages tested
  • 24–53x faster than Python/Ruby — compiled performance with scripting-speed iteration
  • 117 stdlib packages — data structures, networking, crypto, JSON, HTTP, ML/AI, debugging, profiling, and more
  • 388 conformance tests — all passing
  • Cross-platform — native on Linux, Docker-based on macOS/Windows
  • Built-in concurrency — goroutine-style green threads with channels
  • ML primitives — tensors, autograd, neural networks, AVX-512 acceleration
  • Jda Forge — high-performance web framework built entirely in Jda (Website)

Current Status

Self-hosting converged (April 2, 2026). The compiler compiles itself and produces a byte-identical binary:

jda0 (asm) → jda1 (374 KB) → jda1_sh2 (2.1 MB) → jda1_sh3
                                                    ^^^^^^^^
                                                    identical — fixed point

Real-World Examples

jda-grep — ripgrep-style text search (~400 lines, 1 MB static binary)

fn search_file(path: &i8, pattern: &i8, pat_len: i64) -> i64 {
    let fd = file_open(path, 0)
    let buf = file_read_all(fd)
    let matches = 0
    let line_num = 1
    for i in range(str_len(buf)) {
        if substr_match(buf, i, pattern, pat_len) {
            print_match(path, line_num, buf, i)
            matches += 1
        }
        if byte_at(buf, i) == 10 { line_num += 1 }
    }
    file_close(fd)
    ret matches
}

Log analyzer — process GB-scale server logs natively

fn analyze_log(path: &i8) -> i64 {
    let fd = file_open(path, 0)
    let total = 0
    let errors = 0
    let latency_sum: f64 = 0.0
    loop file_eof(fd) == 0 {
        let line = file_read_line(fd)
        total += 1
        if str_contains(line, "ERROR") { errors += 1 }
        let ms = parse_latency(line)
        latency_sum = latency_sum + ms
    }
    let avg = latency_sum / int_to_f64(total)
    print("Lines: {total}  Errors: {errors}\n")
    print_f64("Avg latency: ", avg, " ms\n")
    ret 0
}

File search indexer — build an in-memory index over a directory tree

fn index_directory(root: &i8) -> &HashMap {
    let index = hashmap_new()
    let files = find(root, "*.jda")
    for i in range(vec_len(files)) {
        let path = vec_get_str(files, i)
        let content = file_read_all_str(path)
        let words = str_split(content, " ")
        for j in range(vec_len(words)) {
            let w = vec_get_str(words, j)
            hashmap_set(index, w, path)
        }
    }
    ret index
}

All three compile to < 1.1 MB static ELF binaries with zero external dependencies.

→ Getting Started Guides — build a CLI tool, an HTTP server, or train a neural network step by step.

Ecosystem

Jda Forge

Jda Forge is a high-performance web and application framework built entirely in Jda. It leverages the language's native concurrency and systems-level efficiency to provide a modern, type-safe foundation for scalable services.

  • Website: jdalang.org/forge
  • GitHub: jdalang/jda-forge
  • Built in Jda: The framework is 100% Jda code, showcasing the language's capability for building complex, high-level abstractions.

Language Features

Core: functions, structs, arrays, pointers, references, if/else, loops, const, enums, generics, closures, pattern matching, inline assembly

Type System: i64, i32, i8, f64, &T references, const generics (fn foo<const N>()), traits, derive macros (Debug, Eq, Clone, Hash, Ord)

OOP: struct + trait + impl (Rust-style), method dispatch, operator overloading

Concurrency: spawn/channels, green threads, deadlock detection, atomic ops

Compiler: SSA IR, constant folding, DCE, tail call optimization, loop register promotion, peephole opts, register allocator with spill, x86-64 native codegen, ELF output

Download & Install

Platform Download Install
Windows .exe installer Double-click
macOS .pkg installer Double-click
Ubuntu/Debian .deb package sudo dpkg -i jda_*.deb
Fedora/RHEL .rpm package sudo rpm -i jda-*.rpm
Any Linux/macOS Shell script `curl -fsSL https://raw.githubusercontent.com/jdalang/jda-lang/main/install.sh

Multiple versions? Use the Jda Version Manager:

curl -fsSL https://raw.githubusercontent.com/jdalang/jda-lang/main/install-jdavm.sh | sh
jdavm install latest
jdavm install 0.1.1
jdavm use 0.2.0

→ Full installation guide — all platforms, options, troubleshooting, uninstall

Building from Source

Requires Docker (any OS). No NASM or assembly tools needed — the bootstrap compiler is a self-hosted Jda binary.

git clone https://github.com/jdalang/jda-lang.git && cd jda-lang

# Build the Docker image (once)
docker build --platform linux/amd64 -t jda-build docker/

# Build the compiler
docker run --rm --platform linux/amd64 --ulimit stack=524288000:524288000 \
  -v $(PWD):/jda -w /jda/bootstrap/stage0 jda-build make stage1

# Run the test suite (361 tests)
docker run --rm --platform linux/amd64 --ulimit stack=524288000:524288000 \
  -v $(PWD):/jda -w /jda jda-build bash tools/run_tests.sh

# Verify self-hosting (compiler compiles itself)
docker run --rm --platform linux/amd64 --ulimit stack=524288000:524288000 \
  -v $(PWD):/jda -w /jda/bootstrap/stage0 jda-build make selfhost

CLI Usage

# Compile a .jda file (output name derived from input: hello.jda → hello)
jda build hello.jda

# Compile with explicit output path
jda build hello.jda -o my_binary

# Compile and run immediately
jda run hello.jda

# Show version
jda --version

# Show help
jda --help

Legacy syntax is also supported for backward compatibility:

jda hello.jda output_binary

Standard Library (117 packages)

Use --include to link standard library packages:

jda build --include stdlib/prelude.jda myapp.jda
jda build --include stdlib/vec.jda --include stdlib/sort.jda myapp.jda

Or install packages locally:

jda pkg install vec           # copy to lib/
jda pkg install sort
jda pkg search hash           # search packages

Data Structures: vec, hashmap, set, queue, heap, ring, matrix, tuple, kvstore Algorithms: sort, iter, comprehension, tsort, diff, statistics Strings/Encoding: string, fmt, conv, regex, base64, json, csv, uri, textwrap, toml, configparser, xml, htmlparser, email I/O & Filesystem: fs, file_io, find, tempfile, glob, mmap, gzip, tarfile, zipfile, linecache, copy Networking: net/tcp, net/http, net/ws, ipaddr, dns, socketserver, httpserver, httpclient, smtp, ftp, netrc System: os, process, time, timeout, context, args, shell, platform, errno, getpass, sched, signal, mmap Crypto: crypto (AES, SHA-256, ChaCha20), uuid, securerandom, digest Math: math, bitops, fixedpoint, bignum, complex, rational, datetime, calendar Testing: testing, benchmark, log, pp AI/ML: tensor_ops, autograd, nn, transformer, avx512_ops, ptx, rocm Patterns: decorator, dataclass, observer, enum, operator, marshal, pack, encoding, erb, fnmatch, mimetypes, compress

See stdlib/PACKAGES.md for the complete list, or docs/stdlib-md/ for full API docs.

OOP Model

Jda uses struct + trait + impl (like Rust, not class-based):

trait Shape {
    fn area(self: &Self) -> i64
}

struct Circle { radius: i64 }

impl Shape for Circle {
    fn area(self: &Circle) -> i64 { ret self.radius * self.radius * 3 }
}

derive(Debug, Eq, Clone)
struct Config { width: i64  height: i64 }

See docs/language/structs.md for the full OOP guide.

Benchmarks

Best of 3 runs, Docker (Ubuntu 22.04 linux/amd64) on macOS Apple Silicon. All languages tested in the same environment. Full analysis | Source code

Runtime (ms)

Benchmark C Jda Rust Go Python Ruby
sieve 1M 27 24 31 32 416 408
matmul 200x200 30 37 32 40 2,265 998
sum 100M 57 49 30 80 8,183 3,615
fib(35) 40 148 62 126 2,826 1,318
json parse 50K 32 31 33 90 159 342

Compile Time (ms)

Benchmark C (gcc -O2) Jda Rust (rustc -O) Go
sieve 1M 479 45 1,579 658
matmul 200x200 478 42 1,628 695
sum 100M 434 40 1,209 678
fib(35) 495 42 1,269 746
json parse 50K 510 48 1,726 789

Binary Size

C Jda Rust Go
Size 16 KB 1.05 MB 3.95 MB 1.76 MB
Linking dynamic static static static

Head-to-Head

vs C vs Rust vs Go vs Python vs Ruby
Runtime Jda wins 3 of 5 Jda wins 2 of 5 Jda wins 4 of 5 Jda 54x faster Jda 28x faster
Compile Jda 11x faster Jda 33x faster Jda 16x faster
Binary C 65x smaller (dynamic) Jda 3.8x smaller Jda 40% smaller
GC Neither Neither Jda: no GC
Deps gcc + libc Rust toolchain Go toolchain CPython CRuby

Jda: zero external dependencies — bootstrapped from assembly, single static binary.

Complex Benchmarks — macOS Native (ms, lower is better)

Real algorithms with full source in all 6 languages. Measured on macOS Apple Silicon — C/Rust/Go compile to native ARM64; Jda runs x86-64 via Rosetta 2 (ISA handicap).

Problem C Rust Go Jda Ruby Python
Sudoku — 500 puzzles 62 62 66 41 3,854 1,753
LZ77 — 1 MB compress 1,830 2,185 2,721 277 222,424
Regex — 8 pats × 100K 98 221 813 186 7,940 7,406
B-Tree — 1M insert/lookup 282 297 318 586 11,529 10,955
Raytracer — 800×600 19 21 35 331 3,301 4,080

Highlights:

  • Sudoku: Jda 1.5× faster than C/Rust (source-level constraint propagation + DCE)
  • LZ77: Jda 6.6× faster than C — MOD→AND strength reduction + hash-chain hoisting eliminate the bottleneck entirely
  • Regex: Jda beats Go (813ms) and Rust (221ms); Thompson NFA + DFA subset construction
  • BTree / Raytracer: gap to C remains — Rosetta 2 overhead + scalar x86 vs ARM SIMD
Reproduce locally
# Compile Jda benchmarks (requires jda1 binary in bootstrap/stage0/)
docker run --rm --platform linux/amd64 --ulimit stack=524288000:524288000 \
  -v $(PWD):/jda -w /jda/bootstrap/stage0 jda-build \
  sh -c "./jda1 build --macos /jda/benchmarks/complex/sudoku/sudoku.jda -o sudoku_mac"
codesign -s - sudoku_mac && ./sudoku_mac < benchmarks/complex/sudoku/puzzles.txt

# C, Go, Rust — compile natively
clang -O2 -o sudoku_c benchmarks/complex/sudoku/sudoku.c
go build -o sudoku_go benchmarks/complex/sudoku/sudoku.go
rustc -O  -o sudoku_rs benchmarks/complex/sudoku/sudoku.rs

Jda Forge

Jda Forge is a full-stack web framework built entirely in Jda — no C, no dependencies. It provides HTTP routing, middleware, templating, and a database layer, all written in the language itself.

Because Forge is written in Jda, it serves as a real-world proof that the language is ready for production web development — and benefits directly from every compiler improvement.

Tooling

VS Code Extension

Syntax highlighting, LSP integration, and snippets for .jda files.

# Install from source
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).

See tools/vscode-jda/ for details.

Version Manager (jdavm)

Install and switch between multiple Jda versions — like rustup, nvm, or rvm.

# Install jdavm
curl -fsSL https://raw.githubusercontent.com/jdalang/jda-lang/main/install-jdavm.sh | sh

# Install and switch versions
jdavm install latest         # download latest release
jdavm install 0.1.1          # install older version
jdavm use 0.2.0              # switch active version
jdavm list                   # see installed versions

Works on Linux and macOS natively. On Windows, use inside WSL2.

CLI Tools

Tool Command Description
Compiler jda build / jda run Compile and run .jda files
Formatter jda fmt Format source code
Test runner jda test Run test files with assertions
Benchmarker jda bench Benchmark fn bench_* functions
Doc generator jda doc Generate HTML/Markdown docs from comments
Package manager jda pkg Install, search, and manage stdlib 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

Repository Layout

apps/              Real applications (jda-grep)
bootstrap/
  stage0/          Build system + jda0 (assembly bootstrap)
  stage1/          jda1 compiler source (jda1.jda — self-hosted)
stdlib/            117 standard library packages
tools/             CLI tools (jda, jdavm, jda-doc, jda-test, jda-pkg, etc.)
tests/             361 conformance tests (pass + fail)
benchmarks/        Performance benchmarks (Jda vs C/Go/Rust/Python/Ruby)
examples/          Example programs
installers/        Native installers (.deb, .rpm, .pkg, .exe)
docs/
  getting-started/ Hands-on guides (CLI tool, HTTP server, ML)
  language/        Language reference (syntax, structs/OOP, stdlib, toolchain, compiler)
  stdlib/          HTML API docs (generated by jda-doc)
  stdlib-md/       Markdown API docs for GitHub (generated by jda-doc-md)
  contributing/    Contributing guide
prompts/           LLM system prompts for AI coding assistants
docker/            Dockerfile for build environment

Documentation

Official Website

  • jdalang.org — Official Jda language website, documentation, and resources.

Getting Started

Language Reference (Markdown — GitHub)

  • Syntax — variables, types, functions, control flow, operators
  • Structs & OOP — structs, traits, impl, derive, generics, closures, unsafe
  • Standard Library — all 117 packages by category
  • Toolchain — CLI commands, package manager, doc generator, testing
  • Compiler Architecture — pipeline, data structures, self-hosting

API Reference

  • Markdown docs — GitHub-compatible, per-package API reference
  • HTML docs — website-ready, generated by jda doc

LLM / AI Integration

  • LLM Context File — complete language reference in one file, optimized for LLM context windows
  • System Prompt — ready-to-use system prompt for ChatGPT, Claude, etc.
  • llms.txt — standardized LLM discovery file

Feed docs/llm-context.md into any LLM to enable it to write correct Jda code.

Contributing

License

Jda is free and open source software, released under the MIT License.