diff --git a/AI_AGENT.md b/AI_AGENT.md index 47f1c4c..57c98b9 100644 --- a/AI_AGENT.md +++ b/AI_AGENT.md @@ -4,7 +4,7 @@ ## What is this project? -**Clojure/Nim** is a Clojure dialect that compiles to Nim, then to C, then to native binaries. +**Bara Lang** is a Clojure dialect that compiles to Nim, then to C, then to native binaries. Current state: **Working compiler + REPL + macro system + file/git ops + Nim interop.** diff --git a/LICENSE b/LICENSE index 54a786d..4c190d1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2026 Clojure/Nim Contributors +Copyright (c) 2026 Bara Lang Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/PLAN.md b/PLAN.md index b55ffb7..81e14b4 100644 --- a/PLAN.md +++ b/PLAN.md @@ -1,4 +1,4 @@ -# Clojure/Nim — Test Suite Compliance Plan +# Bara Lang — Test Suite Compliance Plan ## Current Status: 233/233 (100%) diff --git a/benchmarks/run_aot_benchmarks.sh b/benchmarks/run_aot_benchmarks.sh index aa8c99a..7a9bae2 100755 --- a/benchmarks/run_aot_benchmarks.sh +++ b/benchmarks/run_aot_benchmarks.sh @@ -31,7 +31,7 @@ run_aot_bench() { echo "" # Pre-compiled native binary - echo " [Clojure/Nim AOT]" + echo " [Bara Lang AOT]" local nim_total=0 local nim_times=() for ((i=1; i<=runs; i++)); do @@ -71,7 +71,7 @@ run_aot_bench() { if [ $nim_avg -gt 0 ]; then local speedup=$((jvm_avg / nim_avg)) - echo " => Clojure/Nim AOT is ${speedup}x FASTER (avg)" + echo " => Bara Lang AOT is ${speedup}x FASTER (avg)" fi else echo " [JVM Clojure] — not installed" diff --git a/benchmarks/run_benchmarks.sh b/benchmarks/run_benchmarks.sh index 1968191..910b0fe 100755 --- a/benchmarks/run_benchmarks.sh +++ b/benchmarks/run_benchmarks.sh @@ -5,7 +5,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" PROJECT_DIR="$(dirname "$SCRIPT_DIR")" echo "==============================================" -echo " Clojure/Nim vs JVM Clojure — Benchmarks" +echo " Bara Lang vs JVM Clojure — Benchmarks" echo "==============================================" echo "" @@ -17,8 +17,8 @@ run_bench() { echo "--- $name ---" echo "" - # Clojure/Nim - echo " [Clojure/Nim]" + # Bara Lang + echo " [Bara Lang]" local nim_total=0 local nim_times=() for ((i=1; i<=runs; i++)); do @@ -58,7 +58,7 @@ run_bench() { if [ $jvm_avg -gt 0 ]; then local speedup=$((jvm_avg / nim_avg)) - echo " => Clojure/Nim is ${speedup}x FASTER (avg)" + echo " => Bara Lang is ${speedup}x FASTER (avg)" fi else echo " [JVM Clojure] — not installed, skipping" @@ -66,7 +66,7 @@ run_bench() { echo "" } -echo "Building Clojure/Nim..." +echo "Building Bara Lang..." nim c -o:"$PROJECT_DIR/cljnim" "$PROJECT_DIR/src/cljnim.nim" 2>/dev/null echo "" diff --git a/books/clojure-book/README.md b/books/clojure-book/README.md index 0b15434..e879579 100644 --- a/books/clojure-book/README.md +++ b/books/clojure-book/README.md @@ -1,10 +1,10 @@ -# Clojure/Nim — The Native Clojure Book +# Bara Lang — The Native Clojure Book > A practical guide to Clojure that compiles to native binaries. No JVM required. ## What You Will Learn -This book teaches **Clojure** through the lens of **Clojure/Nim** — a real compiler that turns your Clojure code into native machine code via Nim and C. +This book teaches **Clojure** through the lens of **Bara Lang** — a real compiler that turns your Clojure code into native machine code via Nim and C. You do not need Java. You do not need Leiningen. You need Nim, a C compiler, and curiosity. @@ -16,7 +16,7 @@ You do not need Java. You do not need Leiningen. You need Nim, a C compiler, and | [02 — Advanced](en/02-advanced.md) | Transducers, specs, parallelism, performance | Write code that scales. | | [03 — Tooling](en/03-tooling.md) | Project structure, deps, testing, debugging | Ship reliable software. | | [04 — Recipes](en/04-recipes.md) | Common patterns, state management, APIs | Copy-paste solutions that work. | -| **[05 — Clojure/Nim](en/05-clojure-nim.md)** | **Native compilation, AI integration, JSON REPL, WASM** | **What makes this dialect unique.** | +| **[05 — Bara Lang](en/05-bara-lang.md)** | **Native compilation, AI integration, JSON REPL, WASM** | **What makes this dialect unique.** | ## Quick Start @@ -29,7 +29,7 @@ make build && make check ## Running the Examples -Most examples work in any Clojure REPL. Chapter 5 examples are specific to Clojure/Nim: +Most examples work in any Clojure REPL. Chapter 5 examples are specific to Bara Lang: ```bash # Human REPL @@ -53,9 +53,9 @@ Most examples work in any Clojure REPL. Chapter 5 examples are specific to Cloju ## Stats - **8 chapters** (4 core + 4 translated) -- **1 new chapter** on Clojure/Nim (native compilation, AI, cross-targets) -- **All code tested** against Clojure/Nim v0.1.0 +- **1 new chapter** on Bara Lang (native compilation, AI, cross-targets) +- **All code tested** against Bara Lang v0.1.0 --- -*This book is maintained as part of the Clojure/Nim project.* +*This book is maintained as part of the Bara Lang project.* diff --git a/books/clojure-book/bg/05-clojure-nim.md b/books/clojure-book/bg/05-bara-lang.md similarity index 85% rename from books/clojure-book/bg/05-clojure-nim.md rename to books/clojure-book/bg/05-bara-lang.md index 13e90d9..98392a1 100644 --- a/books/clojure-book/bg/05-clojure-nim.md +++ b/books/clojure-book/bg/05-bara-lang.md @@ -1,12 +1,12 @@ -# Clojure/Nim: Native Clojure +# Bara Lang: Native Clojure > Същият език, който обичаш. Компилиран до нативен код. Без JVM. --- -## Какво е Clojure/Nim? +## Какво е Bara Lang? -**Clojure/Nim** е пълен диалект на Clojure, който се компилира до нативен машинен код през Nim компилатора. Това не е интерпретатор — това е истински компилатор с пълен pipeline за оптимизация: +**Bara Lang** е пълен диалект на Clojure, който се компилира до нативен машинен код през Nim компилатора. Това не е интерпретатор — това е истински компилатор с пълен pipeline за оптимизация: ``` Твоят .clj файл @@ -26,7 +26,7 @@ ### Защо native? -| JVM Clojure | Clojure/Nim | +| JVM Clojure | Bara Lang | |-------------|-------------| | Нуждае се от Java runtime | Самостоятелен бинарен файл | | ~2-5 секунди startup | Мигновен старт | @@ -112,7 +112,7 @@ JSON REPL е проектиран за програмно взаимодейст ## AI-асистирана разработка -Clojure/Nim е първата Clojure имплементация, в която AI асистенцията е първокласна функция. +Bara Lang е първата Clojure имплементация, в която AI асистенцията е първокласна функция. ### Обяснение на грешки @@ -154,7 +154,7 @@ export DEEPSEEK_API_KEY="sk-..." ## `loop` / `recur`: Истинска TCO -За разлика от JVM Clojure (който използва `recur`, за да избегне stack overflow, но все пак работи върху stack-based VM), Clojure/Nim компилира `loop`/`recur` до native `while` цикъл: +За разлика от JVM Clojure (който използва `recur`, за да избегне stack overflow, но все пак работи върху stack-based VM), Bara Lang компилира `loop`/`recur` до native `while` цикъл: ```clojure (defn factorial [n] @@ -170,7 +170,7 @@ export DEEPSEEK_API_KEY="sk-..." ## Cross-Compilation Target-и -Clojure/Nim може да таргетира множество платформи от един и същи изходен код: +Bara Lang може да таргетира множество платформи от един и същи изходен код: ### Нативен бинарен файл (по подразбиране) ```bash @@ -201,7 +201,7 @@ nim c -d:release --cpu:wasm32 --os:linux program.nim ## Persistent Структури от Данни -Clojure/Nim имплементира истински **Hash Array Mapped Trie (HAMT)** вектори и карти: +Bara Lang имплементира истински **Hash Array Mapped Trie (HAMT)** вектори и карти: ```clojure (def v (vector 1 2 3)) @@ -263,9 +263,9 @@ Threading макроси, `when-let`, `cond`, `doto`, `some->` — всички --- -## Кога да използваш Clojure/Nim +## Кога да използваш Bara Lang -| Use Case | Clojure/JVM | Clojure/Nim | +| Use Case | Clojure/JVM | Bara Lang | |----------|-------------|-------------| | Големи уеб услуги | ✅ | ⚠️ (ранен етап) | | CLI инструменти | ⚠️ (бавен старт) | ✅ (мигновен) | @@ -286,4 +286,4 @@ Threading макроси, `when-let`, `cond`, `doto`, `some->` — всички --- -*Clojure/Nim е доказателство, че не ти трябва виртуална машина, за да пишеш елегантен, функционален, immutable код. Трябва ти само добър компилатор.* +*Bara Lang е доказателство, че не ти трябва виртуална машина, за да пишеш елегантен, функционален, immutable код. Трябва ти само добър компилатор.* diff --git a/books/clojure-book/bg/index.md b/books/clojure-book/bg/index.md index 3fd9bad..957f56f 100644 --- a/books/clojure-book/bg/index.md +++ b/books/clojure-book/bg/index.md @@ -8,11 +8,11 @@ - **Анонимни функции** - [5.2](bg/01-fundamentals.md#52-анонимни-функции) - **Аритности** - [5.1.2](bg/01-fundamentals.md#512-множество-арности) - **Асинхронно програмиране** - [16](bg/01-fundamentals.md#16-coreasync), [4](bg/04-recipes.md#4-async-рецепти) -- **Атом (Atom)** - [11.1](bg/01-fundamentals.md#11-атоми-atoms), [5](bg/05-clojure-nim.md#конкурентност) -- **AI интеграция** - [5](bg/05-clojure-nim.md#ai-асистирана-разработка) -- **AI агенти** - [5](bg/05-clojure-nim.md#json-repl-за-ai-агенти) -- **Clojure/Nim** - [5](bg/05-clojure-nim.md) — Нативна компилация, AI, JSON REPL -- **Cross-compilation** - [5](bg/05-clojure-nim.md#cross-compilation-target-и) — JS, WASM, shared libraries +- **Атом (Atom)** - [11.1](bg/01-fundamentals.md#11-атоми-atoms), [5](bg/05-bara-lang.md#конкурентност) +- **AI интеграция** - [5](bg/05-bara-lang.md#ai-асистирана-разработка) +- **AI агенти** - [5](bg/05-bara-lang.md#json-repl-за-ai-агенти) +- **Bara Lang** - [5](bg/05-bara-lang.md) — Нативна компилация, AI, JSON REPL +- **Cross-compilation** - [5](bg/05-bara-lang.md#cross-compilation-target-и) — JS, WASM, shared libraries ## Б diff --git a/books/clojure-book/en/05-clojure-nim.md b/books/clojure-book/en/05-bara-lang.md similarity index 87% rename from books/clojure-book/en/05-clojure-nim.md rename to books/clojure-book/en/05-bara-lang.md index cd7cb44..ff83c8a 100644 --- a/books/clojure-book/en/05-clojure-nim.md +++ b/books/clojure-book/en/05-bara-lang.md @@ -1,12 +1,12 @@ -# Clojure/Nim: Native Clojure +# Bara Lang: Native Clojure > The same language you love. Compiled to native binaries. No JVM required. --- -## What is Clojure/Nim? +## What is Bara Lang? -**Clojure/Nim** is a complete Clojure dialect that compiles to native machine code via the Nim compiler. It is not an interpreter — it is a real compiler with a full optimization pipeline: +**Bara Lang** is a complete Clojure dialect that compiles to native machine code via the Nim compiler. It is not an interpreter — it is a real compiler with a full optimization pipeline: ``` Your .clj file @@ -26,7 +26,7 @@ The result is a single executable file, often under **1 MB**, that starts instan ### Why Native? -| JVM Clojure | Clojure/Nim | +| JVM Clojure | Bara Lang | |-------------|-------------| | Needs Java runtime installed | Self-contained binary | | ~2-5 second startup time | Instant startup | @@ -112,7 +112,7 @@ The JSON REPL is designed for programmatic interaction. Every operation has stru ## AI-Powered Development -Clojure/Nim is the first Clojure implementation built with AI assistance as a first-class feature. +Bara Lang is the first Clojure implementation built with AI assistance as a first-class feature. ### Error Explanation @@ -154,7 +154,7 @@ export DEEPSEEK_API_KEY="sk-..." ## `loop` / `recur`: Real TCO -Unlike JVM Clojure (which uses `recur` to avoid stack overflow but still runs on a stack-based VM), Clojure/Nim compiles `loop`/`recur` to a native `while` loop: +Unlike JVM Clojure (which uses `recur` to avoid stack overflow but still runs on a stack-based VM), Bara Lang compiles `loop`/`recur` to a native `while` loop: ```clojure (defn factorial [n] @@ -170,7 +170,7 @@ This generates efficient C code with no function calls. It is **genuinely O(1) s ## Cross-Compilation Targets -Clojure/Nim can target multiple platforms from the same source: +Bara Lang can target multiple platforms from the same source: ### Native Binary (default) ```bash @@ -202,7 +202,7 @@ This is something JVM Clojure simply cannot do. ## Persistent Data Structures -Clojure/Nim implements real **Hash Array Mapped Trie (HAMT)** vectors and maps: +Bara Lang implements real **Hash Array Mapped Trie (HAMT)** vectors and maps: ```clojure (def v (vector 1 2 3)) @@ -264,9 +264,9 @@ Threading macros, `when-let`, `cond`, `doto`, `some->` — all implemented as re --- -## When to Use Clojure/Nim +## When to Use Bara Lang -| Use Case | Clojure/JVM | Clojure/Nim | +| Use Case | Clojure/JVM | Bara Lang | |----------|-------------|-------------| | Large web services | ✅ | ⚠️ (early stage) | | CLI tools | ⚠️ (slow startup) | ✅ (instant) | @@ -287,4 +287,4 @@ Threading macros, `when-let`, `cond`, `doto`, `some->` — all implemented as re --- -*Clojure/Nim is proof that you do not need a virtual machine to write elegant, functional, immutable code. You just need a good compiler.* +*Bara Lang is proof that you do not need a virtual machine to write elegant, functional, immutable code. You just need a good compiler.* diff --git a/books/clojure-book/en/index.md b/books/clojure-book/en/index.md index 9e2114a..11da072 100644 --- a/books/clojure-book/en/index.md +++ b/books/clojure-book/en/index.md @@ -24,10 +24,10 @@ - **Caching** - [1.5](en/01-fundamentals.md#15-memoization), [8.6](en/02-advanced.md#86-preload-and-cache), [8.2](en/04-recipes.md#82-caching-with-ttl) - **Case** - [6.1.5](en/01-fundamentals.md#615-case) -- **Channels** - [16.1](en/01-fundamentals.md#161-channels), [5](en/05-clojure-nim.md#concurrency) -- **Clojure/Nim** - [5](en/05-clojure-nim.md) — Native compilation, AI integration, JSON REPL -- **Compilation (native)** - [5](en/05-clojure-nim.md#what-is-clojure-nim) -- **Cross-compilation** - [5](en/05-clojure-nim.md#cross-compilation-targets) — JS, WASM, shared libraries +- **Channels** - [16.1](en/01-fundamentals.md#161-channels), [5](en/05-bara-lang.md#concurrency) +- **Bara Lang** - [5](en/05-bara-lang.md) — Native compilation, AI integration, JSON REPL +- **Compilation (native)** - [5](en/05-bara-lang.md#what-is-bara-lang) +- **Cross-compilation** - [5](en/05-bara-lang.md#cross-compilation-targets) — JS, WASM, shared libraries - **Characters** - [4.3](en/01-fundamentals.md#43-characters) - **Chunked sequences** - [2.2](en/02-advanced.md#22-chunked-sequences) - **Circuit breaker** - [3.4](en/04-recipes.md#34-circuit-breaker) diff --git a/cljnim.nimble b/cljnim.nimble index e7c5700..634411c 100644 --- a/cljnim.nimble +++ b/cljnim.nimble @@ -1,6 +1,6 @@ # Package version = "0.1.0" -author = "Clojure/Nim Team" +author = "Bara Lang Team" description = "Clojure dialect compiling to Nim" license = "MIT" srcDir = "src" diff --git a/examples/ai_tools.clj b/examples/ai_tools.clj index 303b151..ee7f827 100644 --- a/examples/ai_tools.clj +++ b/examples/ai_tools.clj @@ -1,10 +1,10 @@ ; AI-Native Tooling Demo -; File and Git operations from Clojure +; File and Git operations from Bara Lang (println "=== File Operations ===") ; Write a file -(file/write "/tmp/ai_demo.txt" "Hello from Clojure/Nim AI!") +(file/write "/tmp/ai_demo.txt" "Hello from Bara Lang AI!") ; Read it back (println (file/read "/tmp/ai_demo.txt")) diff --git a/examples/ffi.clj b/examples/ffi.clj index 0ad37d5..2ab925c 100644 --- a/examples/ffi.clj +++ b/examples/ffi.clj @@ -1,4 +1,4 @@ -; C FFI — Достъп до C функции директно от Clojure +; C FFI — Достъп до C функции директно от Bara Lang ; (c-fn sin "math.h" :double [:double]) ; Това генерира Nim proc с {.importc.} pragma diff --git a/examples/hello.clj b/examples/hello.clj index 49c9283..338aca9 100644 --- a/examples/hello.clj +++ b/examples/hello.clj @@ -1,3 +1,3 @@ -; First Clojure/Nim program +; First Bara Lang program (println "Hello, Nim world!") (println (+ 1 2 3)) diff --git a/examples/jsonista.clj b/examples/jsonista.clj index 17030f3..614b090 100644 --- a/examples/jsonista.clj +++ b/examples/jsonista.clj @@ -1,10 +1,10 @@ -; jsonista.clj — Production JSON library example for Clojure/Nim +; jsonista.clj — Production JSON library example for Bara Lang ; Modeled after https://github.com/metosin/jsonista ; Replaces Java/Jackson dependencies with native Nim JSON performance ; ; This example demonstrates: ; - Fast JSON encoding/decoding without JVM overhead -; - Keyword keys support (Clojure idiomatic) +; - Keyword keys support (Bara Lang idiomatic) ; - File I/O ; - Pretty printing ; - Complex nested data structures diff --git a/examples/jsonista.md b/examples/jsonista.md index 041a481..48f64af 100644 --- a/examples/jsonista.md +++ b/examples/jsonista.md @@ -1,4 +1,4 @@ -# jsonista.clj — Production JSON библиотека за Clojure/Nim +# jsonista.clj — Production JSON библиотека за Bara Lang > Моделирана след [metosin/jsonista](https://github.com/metosin/jsonista), но с **нула Java зависимости**. @@ -6,7 +6,7 @@ Този пример демонстрира пълноценна JSON библиотека с API идентично на jsonista, но: -| | JVM jsonista | Clojure/Nim jsonista | +| | JVM jsonista | Bara Lang jsonista | |---|---|---| | JVM зависимост | ✅ Required (JVM + Jackson) | ❌ Няма | | Jackson/databind | ✅ Required | ❌ Няма | @@ -21,8 +21,8 @@ ; Основни функции (json/write-value-as-string data) ; -> JSON string (json/write-value-as-string data opts) ; -> JSON string с опции -(json/read-value json-string) ; -> Clojure data -(json/read-value json-string opts) ; -> Clojure data с опции +(json/read-value json-string) ; -> Bara Lang data +(json/read-value json-string opts) ; -> Bara Lang data с опции (json/write-value-to-file path data) ; -> записва във файл (json/write-value-to-file path data opts) ; -> записва във файл (json/read-value-from-file path) ; -> чете от файл @@ -86,7 +86,7 @@ ``` Clojure code ↓ -Clojure/Nim Compiler +Bara Lang Compiler ↓ Nim код + cljnim_runtime (std/json) ↓ @@ -127,7 +127,7 @@ make check ## Сравнение с оригиналния jsonista -| Feature | JVM jsonista | Clojure/Nim | +| Feature | JVM jsonista | Bara Lang | |---|---|---| | `write-value-as-string` | ✅ | ✅ | | `read-value` | ✅ | ✅ | @@ -140,4 +140,4 @@ make check --- -**Извод:** С Clojure/Nim получаваш същото production-ready JSON API, но без целия Java overhead — native бинарен файл, мигновен старт, и достъп до цялата Nim/C ecosystem. +**Извод:** С Bara Lang получаваш същото production-ready JSON API, но без целия Java overhead — native бинарен файл, мигновен старт, и достъп до цялата Nim/C ecosystem. diff --git a/experiments/README.md b/experiments/README.md index 6b238dd..927d917 100644 --- a/experiments/README.md +++ b/experiments/README.md @@ -1,4 +1,4 @@ -# Clojure/Nim Experiments +# Bara Lang Experiments Unconventional compilation targets that JVM Clojure cannot do. @@ -10,7 +10,7 @@ Unconventional compilation targets that JVM Clojure cannot do. | `native-lib/` | ✅ Working | Clojure → Nim → C shared library (.so) | | `wasm-target/` | 🏗️ Skeleton | Clojure → Nim → WASM via Emscripten | -## web-target — Clojure in the Browser +## web-target — Bara Lang in the Browser ```bash cd web-target @@ -19,9 +19,9 @@ node -e "require('./build/math.js'); console.log(jsSquare(7))" # → 49 ``` -**Unique:** No JVM, no JavaScript source code — pure Clojure compiled to JS. +**Unique:** No JVM, no JavaScript source code — pure Bara Lang compiled to JS. -## native-lib — Clojure as a C Library +## native-lib — Bara Lang as a C Library ```bash cd native-lib @@ -31,9 +31,9 @@ cd test_client && make && LD_LIBRARY_PATH=../build ./test_client # → c_factorial(5) = 120 ``` -**Unique:** Call Clojure functions from Python, Rust, Go, C via FFI. +**Unique:** Call Bara Lang functions from Python, Rust, Go, C via FFI. -## wasm-target — Clojure at Native Speed in Browser +## wasm-target — Bara Lang at Native Speed in Browser ```bash cd wasm-target @@ -42,14 +42,14 @@ cd wasm-target # Open www/index.html in browser ``` -**Unique:** Clojure running as WebAssembly — faster than ClojureScript, smaller than JVM. +**Unique:** Bara Lang running as WebAssembly — faster than ClojureScript, smaller than JVM. ## Architecture All experiments share the same pipeline: ``` -Clojure Source (.clj) +Bara Lang Source (.clj) ↓ cljnim compile-lib ↓ diff --git a/experiments/native-lib/README.md b/experiments/native-lib/README.md index 5c88c61..ede2eb3 100644 --- a/experiments/native-lib/README.md +++ b/experiments/native-lib/README.md @@ -1,12 +1,12 @@ -# Clojure/Nim → Native Shared Library +# Bara Lang → Native Shared Library -Compile Clojure code to a C shared library (`.so` / `.dll` / `.dylib`). +Compile Bara Lang code to a C shared library (`.so` / `.dll` / `.dylib`). ## Why? -- **Embed Clojure in Python/Rust/Go/C** via FFI +- **Embed Bara Lang in Python/Rust/Go/C** via FFI - **Tiny binaries** — no JVM overhead -- **True C ABI** — call Clojure functions from any language +- **True C ABI** — call Bara Lang functions from any language ## Quick Start diff --git a/experiments/native-lib/build/math.nim b/experiments/native-lib/build/math.nim index 188f3bc..215392e 100644 --- a/experiments/native-lib/build/math.nim +++ b/experiments/native-lib/build/math.nim @@ -1,4 +1,4 @@ -# Generated by Clojure/Nim +# Generated by Bara Lang import cljnim_runtime proc square*(x: CljVal): CljVal = diff --git a/experiments/native-lib/native_wrappers.nim b/experiments/native-lib/native_wrappers.nim index 6162de1..448985b 100644 --- a/experiments/native-lib/native_wrappers.nim +++ b/experiments/native-lib/native_wrappers.nim @@ -1,9 +1,9 @@ -# C-friendly wrappers around Clojure-generated code +# C-friendly wrappers around Bara Lang-generated code # Exports plain C types (int, char*) instead of CljVal import cljnim_runtime -# Import the generated Clojure functions +# Import the generated Bara Lang functions include build/math proc c_square*(x: cint): cint {.exportc, dynlib.} = diff --git a/experiments/native-lib/test_client/main.c b/experiments/native-lib/test_client/main.c index 66c0545..88857a3 100644 --- a/experiments/native-lib/test_client/main.c +++ b/experiments/native-lib/test_client/main.c @@ -12,13 +12,13 @@ extern void NimMain(void); int main(void) { NimMain(); - printf("=== Clojure/Nim Native Library Test ===\n\n"); + printf("=== Bara Lang Native Library Test ===\n\n"); printf("c_square(7) = %d\n", c_square(7)); printf("c_add(10, 20) = %d\n", c_add(10, 20)); printf("c_factorial(5) = %d\n", c_factorial(5)); printf("c_greet(\"World\") = %s\n", c_greet("World")); - printf("\nAll tests passed! Clojure in a .so file.\n"); + printf("\nAll tests passed! Bara Lang in a .so file.\n"); return 0; } diff --git a/experiments/wasm-target/README.md b/experiments/wasm-target/README.md index b47ac30..ba2a73e 100644 --- a/experiments/wasm-target/README.md +++ b/experiments/wasm-target/README.md @@ -1,6 +1,6 @@ -# Clojure/Nim → WASM (via Emscripten) +# Bara Lang → WASM (via Emscripten) -Compile Clojure code to WebAssembly using Nim's Emscripten backend. +Compile Bara Lang code to WebAssembly using Nim's Emscripten backend. ## Why? @@ -31,7 +31,7 @@ Then open `www/index.html` in a browser. 1. `cljnim compile-lib` — generates Nim with exported functions 2. `nim c -d:emscripten` — compiles Nim to WASM + JS glue 3. Browser loads `math.js` (glue) + `math.wasm` (WASM module) -4. JS calls `_wasmSquare(7)` → WASM executes native Clojure code +4. JS calls `_wasmSquare(7)` → WASM executes native Bara Lang code ## Future diff --git a/experiments/wasm-target/wasm_wrappers.nim b/experiments/wasm-target/wasm_wrappers.nim index 526910b..2d03deb 100644 --- a/experiments/wasm-target/wasm_wrappers.nim +++ b/experiments/wasm-target/wasm_wrappers.nim @@ -1,4 +1,4 @@ -# WASM-friendly wrappers around Clojure-generated code +# WASM-friendly wrappers around Bara Lang-generated code # Uses Emscripten FFI: cint → JS number, cstring → JS string import cljnim_runtime diff --git a/experiments/wasm-target/www/index.html b/experiments/wasm-target/www/index.html index 48a1c99..229005a 100644 --- a/experiments/wasm-target/www/index.html +++ b/experiments/wasm-target/www/index.html @@ -2,7 +2,7 @@
-Clojure compiled to Nim, then to WebAssembly via Emscripten.
+Bara Lang compiled to Nim, then to WebAssembly via Emscripten.
Clojure code compiled to Nim, then to JavaScript. Running in your browser.
+Bara Lang code compiled to Nim, then to JavaScript. Running in your browser.
' Evaluate expression"
- echo " cljnim ai '' Generate Clojure code with AI"
+ echo " cljnim ai '' Generate Bara Lang code with AI"
echo " cljnim tui Start interactive TUI"
echo ""
echo "REPL Commands:"
diff --git a/src/emitter.nim b/src/emitter.nim
index f3ffde7..59497ad 100644
--- a/src/emitter.nim
+++ b/src/emitter.nim
@@ -1,4 +1,4 @@
-# Clojure → Nim Emitter
+# Bara Lang → Nim Emitter
import strutils, sets, algorithm
import types
import macros
@@ -2059,7 +2059,7 @@ proc emitProgramInternal(forms: seq[CljVal]): string =
pushScope()
requiredImports = initHashSet[string]()
var headerLines: seq[string] = @[
- "# Generated by Clojure/Nim",
+ "# Generated by Bara Lang",
"import cljnim_runtime",
]
diff --git a/src/reader.nim b/src/reader.nim
index e973717..a4a8403 100644
--- a/src/reader.nim
+++ b/src/reader.nim
@@ -1,4 +1,4 @@
-# Clojure Reader (EDN subset)
+# Bara Lang Reader (EDN subset)
import strutils
import types
diff --git a/src/repl.nim b/src/repl.nim
index 5554906..be45393 100644
--- a/src/repl.nim
+++ b/src/repl.nim
@@ -1,4 +1,4 @@
-# AI-First REPL for Clojure/Nim
+# AI-First REPL for Bara Lang
import os, osproc, strutils, json, times, net
import reader, emitter, types, macros, eval, ai_assist
@@ -82,7 +82,7 @@ proc buildProgram(state: ReplState, form: CljVal, isDef: bool): string =
allForms.add(form)
var header = @[
- "# Generated by Clojure/Nim REPL",
+ "# Generated by Bara Lang REPL",
"import cljnim_runtime",
"",
]
@@ -252,7 +252,7 @@ proc evalForm*(state: var ReplState, formStr: string): JsonNode =
}
proc runHumanRepl*(state: var ReplState) =
- echo "Clojure/Nim REPL"
+ echo "Bara Lang REPL"
echo "Type :quit to exit, :help for commands"
echo ""
@@ -275,7 +275,7 @@ proc runHumanRepl*(state: var ReplState) =
echo ":defs List defined vars"
echo ":clear Clear all definitions"
echo ":ns Show current namespace"
- echo ":ai Ask AI to generate Clojure code"
+ echo ":ai Ask AI to generate Bara Lang code"
echo ":optimize Ask AI to suggest optimizations"
echo ":debug Ask AI to debug an expression"
of ":defs":
diff --git a/src/tui.nim b/src/tui.nim
index 2774ae8..50b495b 100644
--- a/src/tui.nim
+++ b/src/tui.nim
@@ -1,4 +1,4 @@
-# Clojure/Nim TUI — Terminal User Interface
+# Bara Lang TUI — Terminal User Interface
# Fullscreen menu-driven interface for cljnim
import std/os
@@ -72,7 +72,7 @@ proc runTui*() =
illwillDeinit()
showCursor()
echo ""
- echo "=== Starting Clojure/Nim REPL ==="
+ echo "=== Starting Bara Lang REPL ==="
echo "Type :quit to return to TUI"
echo ""
var replState = initReplState(rmHuman)
diff --git a/src/tui_screens.nim b/src/tui_screens.nim
index a5b4375..6789fbd 100644
--- a/src/tui_screens.nim
+++ b/src/tui_screens.nim
@@ -127,7 +127,7 @@ proc drawMainMenu*(tb: var TerminalBuffer, state: var ScreenState) =
let h = terminalHeight()
# Header
- let title = "Clojure/Nim TUI"
+ let title = "Bara Lang TUI"
tb.write(centerX(title, w), 1, fgCyan, title)
tb.drawHorizLine(0, w - 1, 2, doubleStyle = true)
@@ -436,7 +436,7 @@ proc drawRun*(tb: var TerminalBuffer, state: var ScreenState) =
let w = terminalWidth()
let h = terminalHeight()
- tb.write(centerX("Run Clojure File", w), 1, fgCyan, "Run Clojure File")
+ tb.write(centerX("Run Bara Lang File", w), 1, fgCyan, "Run Bara Lang File")
tb.drawHorizLine(0, w - 1, 2, doubleStyle = true)
let valX = 12
@@ -646,7 +646,7 @@ proc drawHelp*(tb: var TerminalBuffer, state: var ScreenState) =
tb.drawHorizLine(0, w - 1, 2, doubleStyle = true)
let helpText = @[
- "Clojure/Nim TUI v0.1.0",
+ "Bara Lang TUI v0.1.0",
"",
"Navigation:",
" Arrow Keys / Tab Navigate menus and fields",
diff --git a/src/types.nim b/src/types.nim
index a9c6e6f..e1830c9 100644
--- a/src/types.nim
+++ b/src/types.nim
@@ -1,4 +1,4 @@
-# Clojure Value Types (Compiler internal representation)
+# Bara Lang Value Types (Compiler internal representation)
import sequtils, strutils
type