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 β Function Support β 103+ 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"
}
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.bndhoristhir
dekhi
jodinahole
kajferot- Parameters
- Function Calls
- Identifiers
- Number Literals
- String Literals
- Boolean Literals
- Null Literals
- Unary Operators
- Binary Operators
- Parenthesized Expressions
sotti
mittha
khali
Not implemented yet:
- Assignment Expressions
- While Loops
- For Loops
- Arrays
- Objects
- 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.
- Assignment Expressions
- Variable Reassignment
- Compound Assignment Operators
- While Loops
- For Loops
- Arrays
- Objects
- Imports / Exports
- Modules
- 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
103+ 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.