A natural-language-like programming language that compiles to native code via LLVM.
- Pattern-based syntax that reads like English
- Compiles to native executables via LLVM
- Static typing with full type inference
- Standard library written in DynLex itself
- VS Code extension with LSP support
./scripts/build.shRequires C++23, CMake, Ninja, nlohmann_json, and LLVM 20+.
DynLex can be built as a browser-hosted compiler module (dynlex_web.js/.wasm) with a Monaco-based web UI.
This target requires Emscripten (emcmake, emcc) and an LLVM build/toolchain compatible with the Emscripten target (LLVM_DIR if needed).
Host-native LLVM installs (for example /usr/lib/llvm-*) are not wasm-linkable for this target.
Build compiler WASM artifacts and copy them into the web app:
source ~/emsdk/emsdk_env.sh
export LLVM_DIR="$HOME/toolchains/llvm-wasm-20/install/lib/cmake/llvm"
./scripts/build_web.shRun the compiler WASM smoke test:
./scripts/test_web_smoke.shRun the web app:
cd src/web/ide
npm install
npm run devRefresh the deployable static web root (web/) after IDE changes:
./scripts/build_web_root.shWeb layout:
src/web/ide/: IDE source (Vite + Monaco)web/: deployable web root (site/wiki source + built IDE assets)
The web app uses:
- single editable source file at
/workspace/main.dl - bundled stdlib from
/lib/*.dlin Emscripten virtual FS - live debounced compile with diagnostics markers
- LSP-powered Monaco interactions (hover, go-to-definition, semantic tokens)
- built-in light and dark themes
Runexecuting the latest successful emitted program WASM
Compiler WASM C ABI exports:
dynlex_web_initdynlex_web_set_main_sourcedynlex_web_compile_and_emit_wasmdynlex_web_get_diagnostics_jsondynlex_web_get_output_wasm_ptr/dynlex_web_get_output_wasm_lendynlex_web_get_output_wasm_base64dynlex_web_get_compiler_log_jsondynlex_web_get_lsp_hover_jsondynlex_web_get_lsp_definition_jsondynlex_web_get_lsp_semantic_tokens_json
Linux (apt/dnf/pacman/zypper):
./scripts/install.shmacOS (Homebrew):
./scripts/install.sh
if brew info llvm@20 >/dev/null 2>&1; then
export PATH="$(brew --prefix llvm@20)/bin:$PATH"
else
export PATH="$(brew --prefix llvm)/bin:$PATH"
fiWindows (winget):
.\scripts\install.ps1
# if clang is not on PATH after install, set LLVM path manually:
$env:PATH="$env:ProgramFiles\LLVM\bin;$env:PATH"
$env:LLVM_DIR="$env:ProgramFiles\LLVM\lib\cmake\llvm"./build/dynlex program.dl -o program.out && ./program.outCompiler/release version source of truth is metadata/VERSION.
Create and push a release tag with automatic version bump:
./scripts/release.sh patch # or: minor, major, set X.Y.ZFor sanitizer leak checks that ignore known process-lifetime allocations from third-party libraries (for example LLVM internals), use:
./scripts/asan_leak_check.shBy default this runs build-asan/dynlex with scripts/lsan.supp.
From repository benchmarks:
| Benchmark | Python | DynLex O0 | DynLex O3 |
|---|---|---|---|
| Sum 0..100,000,000 | 6.556s | 0.196s (33x faster) | 0.001s (6556x faster) |
| Collatz 1..1,000,000 | 11.363s | 0.969s (12x faster) | 0.221s (51x faster) |
Benchmark details and source programs:
Times are hardware- and toolchain-dependent; run the benchmark files locally for your exact environment.
Launchpad packaging lives in packaging/launchpad. Use
that directory for Debian metadata, source-package builds, and PPA publishing so
the project root stays focused on the compiler itself.