Introduction
Welcome to the Introduction of Bnlang.
What is Bnlang?
Bnlang is the Bangla Programming Language that lets you write code in Bangla, English, or Banglish—side by side.
It’s designed for learners and professionals who want the comfort of native script while staying compatible with mainstream tooling.
Design goals
- Native-first learning: let students think and code in their everyday language.
- Interoperability: interop with popular ecosystems (files, processes, networking) and standard data formats (JSON, UTF-8).
- Predictable syntax: familiar to JavaScript developers, with clear, minimal rules.
- Practical tooling: CLI, formatter, linter, VS Code support, and a package manager (BPM).
Language philosophy
- Clarity over cleverness: explicit syntax and readable keywords.
- One way to do it: reduce ambiguity and foot‑guns.
- Progressive disclosure: basics first; advanced features when you need them.
How Bnlang works
Bnlang code is parsed and executed by a runtime that understands multiple keyword sets (Bangla/English/Banglish) but maps them to the same semantics.
Core libraries expose OS features, I/O, networking, buffers, child processes, and timers—modeled after proven designs.
Interoperability
- Calling out to the OS: spawn processes, read/write files, use environment variables.
- Data exchange: JSON, text encodings (UTF‑8, UTF‑16LE, Base64, Hex).
- FFI/Bridges (planned): interop with native extensions for performance‑critical paths.
Ecosystem
- BPM (Bnlang Package Manager): install, update, and publish libraries.
- Editor support: VS Code extension with syntax highlighting, completion, formatting, and snippets.
- Tooling: test runner, formatter, and CLI utilities for project scaffolding (planned).
Language surface (high level)
- Basics: variables, numbers, strings, booleans, arrays, maps, functions.
- Control flow: if/else, switch, loops (for/while), try/catch/finally.
- Modules: import/export modules; standard library for files, paths, buffers, timers.
- Concurrency (planned): lightweight workers/messages.
- Networking: sockets/HTTP helpers (incremental rollout).
Example keywords (aligned sets)
The language provides aligned keywords across three sets. You can pick one style per file or mix sparingly.
Concept | English | Bangla | Banglish |
---|---|---|---|
if | if | যদি | jodi |
else | else | নাহলে | nahole |
function | function | ফাংশন | function |
return | return | ফেরত | ferot |
Tip: keep a consistent style within a file for readability.
Hello, Bnlang (three styles)
// English
function main() {
print("Hello, Bnlang!");
}
// Bangla
ফাংশন মেইন() {
লিখুন("হ্যালো, Bnlang!");
}
// Banglish
function main() {
likhun("Hello, Bnlang!");
}
Installation overview
- Download Bnlang binaries for Windows/macOS/Linux from the official releases.
- Add
bnl
to your PATH. - (Optional) Install BPM to manage packages globally and per project.
- Install the VS Code extension for syntax highlighting and formatting.
Project layout
my-app/
├─ src/
│ └─ main.bnl
├─ bnl_package.json
└─ README.md
Versioning and docs
- Versions follow
vMAJOR.MINOR.PATCH
. - Docs are versioned:
/docs/v1.0.0/...
with locale segments for English, Bangla, and Banglish.
Contributing
We welcome contributions to language design, standard library, docs, and editor tooling.
Start with issues tagged good-first-issue and follow the contribution guidelines.
Roadmap (snapshot)
- ✅ Core runtime & stdlib (files, buffers, timers)
- ✅ VS Code extension (highlight, format, snippets)
- 🚧 Networking helpers (HTTP/Sockets)
- 🚧 Workers & concurrency primitives
- 🚧 FFI/Bridge for native extensions
- 🚧 Package signing & integrity checks in BPM
FAQ
Is Bnlang only for Bangladesh?
No. While it centers Bangla users, the design emphasizes international compatibility.
Can I mix Bangla and English in the same file?
Yes, but keep it consistent—your team should agree on a style per repo/module.
Does Bnlang replace existing ecosystems?
No. It integrates with them; use Bnlang where it improves learning and readability.