Introduction
Bnlang is a dual-language programming language and runtime. You can write the same program in English or Bangla — the parser maps both keyword sets to the same syntax tree, so the language itself is a single, predictable thing.
Bnlang is native: a tree-walking interpreter written in modern C++ with a libuv event loop. There is no transpilation step and no JavaScript engine — bnl runs your .bnl file directly.
Design principles
- Predictable semantics. Small, regular syntax. Fixed-arity functions. No surprising overloads, no implicit type coercions worth memorizing.
- One way to do it. No
let/const/vartrio — justvar. No===and==debate — just==. Nonullandundefinedsplit — justnull. - Batteries included. File I/O, HTTP/WebSocket server and client, templating, SQLite/PostgreSQL/MySQL/MongoDB, crypto, timers, JSON, regex — all in the standard library.
- Extensible. Drop a
.dll/.so/.dylibnext to abnl.jsonandimportit like any other module. Plugins use a single drop-in C header — they can be written in C, C++, Rust, Go, Zig, or anything with a C ABI.
Runtime stack (under the hood)
- C++20 — the interpreter, value model, and every built-in module.
- libuv — cross-platform event loop and async I/O primitives.
- OpenSSL — TLS for HTTPS / WebSocket-over-TLS, plus hashing, HMAC, base64/hex codecs.
- llhttp — fast HTTP/1.1 parser used by the built-in web server and client.
- SQLite / libpq / libmariadb / mongo-c-driver — embedded SQLite and first-class clients for PostgreSQL, MySQL/MariaDB, MongoDB.
- zlib — gzip/deflate.
Hello, Bnlang (two ways)
// English
print("Hello, Bnlang!");
// Bangla
লিখুন("হ্যালো, Bnlang!");
Both produce the same output. The lexer maps print and লিখুন to the same built-in.
Installation
- Download the latest binary for your platform from the Releases page — Windows (
.exe/.zip), Linux (.tar.gz), macOS (.pkg/.tar.gz). - Make sure
bnlis on your PATH. - Verify:
bnl --version
# Bnlang (bnl) 1.0.0 (windows)
Project layout
my-app/
├─ src/
│ └─ main.bnl
├─ bnl.json # project manifest (managed by bpm)
├─ bnl.lock # lockfile (generated)
└─ deps/ # installed packages
Versioning and docs
Versions follow vMAJOR.MINOR.PATCH. Docs are versioned at /docs/v1.0.0/... with English and Bangla locales.