chore: rebrand Clojure/Nim → Bara Lang across codebase

- 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
This commit is contained in:
2026-05-11 12:23:29 +03:00
parent 606605c95c
commit 79cd9c08d8
41 changed files with 128 additions and 128 deletions
+7 -7
View File
@@ -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.*
@@ -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 код. Трябва ти само добър компилатор.*
+5 -5
View File
@@ -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
## Б
@@ -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.*
+4 -4
View File
@@ -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)