https://github.com/sayedrisat/bnscript
Automation-first programming language that compiles to JavaScript with a real compiler pipeline, runtime, and CLI.
https://github.com/sayedrisat/bnscript
automation bangla cli code-generator compiler developer-tools javascript language-design lexer parser programming-language sayed-risat semantic-analysis transpiler
Last synced: 1 day ago
JSON representation
Automation-first programming language that compiles to JavaScript with a real compiler pipeline, runtime, and CLI.
- Host: GitHub
- URL: https://github.com/sayedrisat/bnscript
- Owner: sayedrisat
- License: mit
- Created: 2026-06-04T04:12:01.000Z (8 days ago)
- Default Branch: main
- Last Pushed: 2026-06-09T16:04:42.000Z (3 days ago)
- Last Synced: 2026-06-10T03:10:42.656Z (2 days ago)
- Topics: automation, bangla, cli, code-generator, compiler, developer-tools, javascript, language-design, lexer, parser, programming-language, sayed-risat, semantic-analysis, transpiler
- Language: JavaScript
- Homepage:
- Size: 278 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ BN Script
**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.
---
## โจ Current Status
**Version:** `v0.1.0-alpha.0`
### Implemented
โ
Lexer
โ
Parser
โ
Abstract Syntax Tree (AST)
โ
Semantic Analyzer
โ
JavaScript Generator
โ
Runtime System
โ
CLI Tool
โ
Function Support
โ
103+ Automated Tests
---
## ๐ฅ Why BN Script?
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.
---
## ๐ Architecture
BN Script follows a real compiler pipeline:
```text
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.
---
## ๐ Quick Example
### BN Script
```bn
kaj greet(name) {
ferot "Hello " + name
}
dekhi greet("Risat")
```
### Generated JavaScript
```js
function greet(name) {
return "Hello " + name;
}
console.log(greet("Risat"));
```
### Output
```txt
Hello Risat
```
---
## โจ Features
### Variables
```bn
dhori name = "Risat"
```
### Constants
```bn
sthir version = 0.1
```
### Output
```bn
dekhi "Hello World"
```
### Conditionals
```bn
jodi score >= 90 {
dekhi "Excellent"
} nahole {
dekhi "Keep Going"
}
```
### Functions
```bn
kaj greet(name) {
ferot "Hello " + name
}
dekhi greet("Risat")
```
### Literals
```bn
sotti
mittha
khali
```
### Operators
```bn
+
-
*
/
%
**
==
!=
>
<
>=
<=
ebong
othoba
na
```
---
## ๐ฆ Installation
Requirements:
* Node.js 18+
Clone the repository:
```bash
git clone https://github.com/sayedrisat/bnscript.git
cd bnscript
npm install
```
Run tests:
```bash
npm test
```
Windows PowerShell:
```powershell
npm.cmd test
```
---
## ๐ฅ CLI Usage
Check a BN Script file:
```bash
node src/cli.js check examples/hello.bn
```
Build JavaScript:
```bash
node src/cli.js build examples/hello.bn
```
Run directly:
```bash
node src/cli.js run examples/hello.bn
```
Future installed usage:
```bash
bn check file.bn
bn build file.bn
bn run file.bn
```
---
## ๐ Supported In Alpha
### Declarations
* `dhori`
* `sthir`
### Output
* `dekhi`
### Conditions
* `jodi`
* `nahole`
### Functions
* `kaj`
* `ferot`
* Parameters
* Function Calls
### Expressions
* Identifiers
* Number Literals
* String Literals
* Boolean Literals
* Null Literals
* Unary Operators
* Binary Operators
* Parenthesized Expressions
### Values
```bn
sotti
mittha
khali
```
---
## โ Current Limitations
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.
---
## ๐บ Roadmap
### v0.2
* Assignment Expressions
* Variable Reassignment
* Compound Assignment Operators
### v0.3
* While Loops
* For Loops
### v0.4
* Arrays
* Objects
### v0.5
* Imports / Exports
* Modules
### Future
* AI Runtime Helpers
* REPL
* Language Server Protocol (LSP)
* VS Code Extension
* Package Ecosystem
---
## ๐งช Testing
Current test coverage includes:
* Lexer Tests
* Parser Tests
* Semantic Analyzer Tests
* Generator Tests
* Runtime Tests
* CLI Tests
* Integration Tests
**103+ tests passing**
---
## ๐ค Contributing
Contributions are welcome.
Good first contributions:
* Compiler improvements
* Parser edge cases
* Better diagnostics
* Documentation
* Examples
* Tests
Before submitting a PR:
1. Run tests
2. Add/update tests
3. Keep changes focused
4. Document limitations
---
## ๐ Documentation
* Getting Started
* CLI Reference
* Language Specification
* Compiler Architecture
* Runtime Design
See the `docs/` directory.
---
## โญ Support The Project
If you find BN Script interesting:
* Star the repository
* Report bugs
* Open feature requests
* Share the project
Repository:
https://github.com/sayedrisat/bnscript
---
## ๐ License
Released under the MIT License.
See `LICENSE` for details.