An automation-first programming language that compiles to JavaScript.
BN Script is a programming language designed to make automation scripts easier to write, read, and maintain while still generating clean JavaScript that runs on Node.js.
It combines a real compiler architecture with a beginner-friendly syntax inspired by Bangla-transliterated keywords.
Version: v0.1.0-alpha.0
β Lexer β Parser β Abstract Syntax Tree (AST) β Semantic Analyzer β JavaScript Generator β Runtime System β CLI Tool β Assignment Expressions β While Loops β Array Literals β Object Literals β Member and Index Access β Function Support β 152 Automated Tests
Modern automation often requires repetitive JavaScript boilerplate for:
- File operations
- API requests
- Environment variables
- Task automation
- Future AI workflows
BN Script aims to make these workflows simpler while still compiling into readable JavaScript.
Instead of replacing JavaScript, BN Script sits on top of it.
Write BN Script.
Compile to JavaScript.
Run anywhere Node.js runs.
BN Script follows a real compiler pipeline:
BN Script Source
β
Lexer
β
Parser
β
Semantic Analyzer
β
JavaScript Generator
β
Runtime
β
CLI
Unlike simple text replacement tools, BN Script performs proper parsing, semantic analysis, and code generation.
kaj greet(name) {
ferot "Hello " + name
}
dekhi greet("Risat")
function greet(name) {
return "Hello " + name;
}
console.log(greet("Risat"));Hello Risatdhori name = "Risat"
sthir version = 0.1
dekhi "Hello World"
jodi score >= 90 {
dekhi "Excellent"
} nahole {
dekhi "Keep Going"
}
dhori count = 0
count = count + 1
count += 4
dhori i = 0
jotokkhon i < 3 {
dekhi i
i = i + 1
}
dhori names = ["Risat", "BN"]
dekhi names[0]
names[1] = "Script"
dhori user = {
name: "Risat",
profile: {
city: "Dhaka"
}
}
dekhi user.name
dekhi user.profile.city
user.name = "Sayed"
kaj greet(name) {
ferot "Hello " + name
}
dekhi greet("Risat")
sotti
mittha
khali
+
-
*
/
%
**
==
!=
>
<
>=
<=
ebong
othoba
na
Requirements:
- Node.js 18+
Clone the repository:
git clone https://github.com/sayedrisat/bnscript.git
cd bnscript
npm installRun tests:
npm testWindows PowerShell:
npm.cmd testCheck a BN Script file:
node src/cli.js check examples/hello.bnBuild JavaScript:
node src/cli.js build examples/hello.bnRun directly:
node src/cli.js run examples/hello.bnFuture installed usage:
bn check file.bn
bn build file.bn
bn run file.bndhorivariable declarationssthirconstant declarationsdekhiprint statementsjodiandnaholeconditionalsjotokkhonwhile loops- Assignment expressions
- Variable reassignment
- Compound assignment:
+=,-=,*=,/= - Array literals
- Object literals
- Member access
- Index access
- Assignment to member and index targets
kajfunction declarationsferotreturn statements inside functions- Function parameters
- Function calls
- Block statements
- Expression statements
- Identifiers
- Number, string, boolean, and null literals
- Booleans:
sotti,mittha - Null:
khali - Unary operators:
na,- - Binary operators:
+,-,*,/,%,**,==,!=,>,<,>=,<=,ebong,othoba - Grouped expressions with parentheses
Not implemented yet:
- Counted
barLoops - For-Each Loops
- Imports / Exports
- Async / Await
- AI Runtime Helpers
- Package Manager
- REPL
- LSP
- VS Code Extension
This project is currently in Alpha and focused on compiler stability.
- Counted Loops
- For-Each Loops
- Imports / Exports
- Modules
- Async / Await
- File/API Automation Helpers
- Runtime Helper Expansion
- Source Maps
- AI Runtime Helpers
- REPL
- Language Server Protocol (LSP)
- VS Code Extension
- Package Ecosystem
Current test coverage includes:
- Lexer Tests
- Parser Tests
- Semantic Analyzer Tests
- Generator Tests
- Runtime Tests
- CLI Tests
- Integration Tests
152 tests passing
Contributions are welcome.
Good first contributions:
- Compiler improvements
- Parser edge cases
- Better diagnostics
- Documentation
- Examples
- Tests
Before submitting a PR:
- Run tests
- Add/update tests
- Keep changes focused
- Document limitations
- Getting Started
- CLI Reference
- Language Specification
- Compiler Architecture
- Runtime Design
See the docs/ directory.
If you find BN Script interesting:
- Star the repository
- Report bugs
- Open feature requests
- Share the project
Repository:
https://github.com/sayedrisat/bnscript
Released under the MIT License.
See LICENSE for details.