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
Bara Lang → Native Shared Library
Compile Bara Lang code to a C shared library (.so / .dll / .dylib).
Why?
- Embed Bara Lang in Python/Rust/Go/C via FFI
- Tiny binaries — no JVM overhead
- True C ABI — call Bara Lang functions from any language
Quick Start
./build.sh
This generates:
build/libmath.so— shared librarybuild/math.h— C headerbuild/math.nim— intermediate Nim source
Test from C
cd test_client
make
./test_client
Expected output:
square(5) = 25
add(10, 20) = 30
cube(3) = 27
factorial(5) = 120
How it works
cljnim compile-lib— generates Nim with exportedproc name*(...)nim c --app:lib --header— compiles Nim to.so+.h- C client links against the
.soand calls functions
Limitations
- Functions use
CljVal(Nim ref object) — client must call Nim runtime helpers NimMain()must be called before using the library