79cd9c08d8
- Bulk replace Clojure/Nim → Bara Lang in src/, lib/, examples/, benchmarks/, experiments/, books/, LICENSE, cljnim.nimble, PLAN.md, AI_AGENT.md - Rename book chapters: 05-clojure-nim.md → 05-bara-lang.md (en + bg) - Update all chapter index links and anchors - Replace project-specific 'Clojure' references with 'Bara Lang' in experiments/, src/ai_assist.nim, src/tui_screens.nim, src/emitter.nim, src/reader.nim, src/types.nim, lib/cljnim_runtime*.nim - Keep legitimate JVM Clojure/ClojureScript/Clojure CLR references intact
962 B
962 B
Bara Lang → WASM (via Emscripten)
Compile Bara Lang code to WebAssembly using Nim's Emscripten backend.
Why?
- Native speed in browser — no JS interpreter overhead
- Smaller than JVM — WASM module is ~100KB vs 50MB+ JVM
- Secure sandbox — WASM runs in browser's security model
Requirements
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
Quick Start
./build.sh
Then open www/index.html in a browser.
How it works
cljnim compile-lib— generates Nim with exported functionsnim c -d:emscripten— compiles Nim to WASM + JS glue- Browser loads
math.js(glue) +math.wasm(WASM module) - JS calls
_wasmSquare(7)→ WASM executes native Bara Lang code
Future
- WASI target (server-side WASM)
- wasm32-wasi-musl via Zig (no Emscripten needed)
- DOM interop through Emscripten bindings