The Somali Programming Language
Soplang is a programming language with syntax inspired by Somali, making programming more accessible to Somali speakers. It combines static and dynamic typing in one language with a focus on clarity and ease of use.
The implementation is in Rust. Soplang runs through a compiled pipeline: Cranelift JIT for run and an AOT build path for standalone binaries. See COMPILER_PLAN.md.
| Path | Description |
|---|---|
| src/ | Rust implementation: lexer, parser, semantic, HIR, runtime, Cranelift JIT, and AOT build backend. |
| examples/ | Soplang example programs (.sop files). |
| benchmarks/ | Compiler benchmark programs, RESULTS.md, README, and run_benchmarks.sh to regenerate results. |
| legacy-interpreter/ | Legacy interpreter code, now in the separate repo soplang/soplang-interpreter. |
| docs/ | Documentation (installation, language reference, contributing). |
| windows/, linux/, macos/ | Platform-specific build and packaging scripts. |
- Dual type system — Static typing (
abn,qoraal, etc.) and dynamic typing (door) - Somali-based syntax — Keywords and concepts in Somali
- Modern paradigms — Functional, procedural, and object-oriented support
- Interactive shell — REPL powered by the compiled JIT pipeline
- Compiled execution — Cranelift JIT for running files, AOT build for standalone binaries
qor("Salaan, Adduunka!") // Hello, World!
door magac = "Sharafdin"
abn age = 25
hawl salaam(qof) {
celi "Salaan, " + qof + "!"
}
qor(salaam(magac))
Build and run:
cargo build --release
./target/release/soplang examples/hello.sop # JIT run
./target/release/soplang -i # REPL
./target/release/soplang -c 'qor("Salaan!")'
./target/release/soplang --build examples/hello.sop -o hello_aot
./hello_aotOr: make build, make run FILE=examples/hello.sop, make shell, make test, make bench.
soplang <file.sop>: run via Cranelift JIT.soplang --build <file.sop> -o <out>: build a standalone native binary.soplang --build ... --opt-level 0..3: tune AOT optimization level.soplang --strict: enable stricter static typing checks.
Current AOT backend is implemented by generating a temporary Rust runner and compiling it to a native executable. This is the supported strategy for now; it can be replaced later with a direct LLVM IR (inkwell) backend.
The compiler (Cranelift JIT) is benchmarked with Criterion. Summary (release build, in-process):
| Benchmark | Mean time |
|---|---|
| fib(25) recursive | ~25.6 ms |
| loop sum 1..100k | ~9.9 ms |
| nested loops 200×200 | ~4.2 ms |
| string concat 1k | ~0.67 ms |
| list ops 5k elements | ~1.3 ms |
| object create 2k | ~252 µs |
How to run: cargo bench or bash benchmarks/run_benchmarks.sh (regenerates RESULTS.md).
Details: benchmarks/RESULTS.md. Benchmark names and performance notes: benchmarks/README.md.
The legacy tree‑walking interpreter has been moved to a dedicated repository:
All new development (compiler, JIT, AOT, CLI) happens here in the Rust implementation.
- Getting started
- Build guide — Build from source on Windows, macOS, and Linux
- Language reference
- Installation
- Contributing
- Rust implementation plan (complete) — Phases 1–7 done
- Compiler plan (in progress) — Cranelift + LLVM
This project is licensed under the MIT License.