{"id":29166137,"url":"https://github.com/ah-naf/borno","last_synced_at":"2025-07-01T08:09:58.164Z","repository":{"id":300815345,"uuid":"860823246","full_name":"ah-naf/Borno","owner":"ah-naf","description":"Borno is a dynamically typed Bangla-based programming language that allows developers to write code using Bangla keywords and identifiers","archived":false,"fork":false,"pushed_at":"2025-06-23T18:30:41.000Z","size":158,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"bangla","last_synced_at":"2025-06-23T19:25:21.673Z","etag":null,"topics":["bangla","golang","interpreter","programming-language"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ah-naf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-21T09:05:03.000Z","updated_at":"2025-06-23T18:30:45.000Z","dependencies_parsed_at":"2025-06-23T19:25:35.641Z","dependency_job_id":"ada1c163-90ab-400e-bd41-b38deb241aa3","html_url":"https://github.com/ah-naf/Borno","commit_stats":null,"previous_names":["ah-naf/borno"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ah-naf/Borno","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ah-naf%2FBorno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ah-naf%2FBorno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ah-naf%2FBorno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ah-naf%2FBorno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ah-naf","download_url":"https://codeload.github.com/ah-naf/Borno/tar.gz/refs/heads/bangla","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ah-naf%2FBorno/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262925004,"owners_count":23385463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bangla","golang","interpreter","programming-language"],"created_at":"2025-07-01T08:09:57.475Z","updated_at":"2025-07-01T08:09:58.149Z","avatar_url":"https://github.com/ah-naf.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Borno Programming Language\n\nBorno is a dynamically typed **Bangla-based** programming language that allows developers to write code using **Bangla keywords** and identifiers. Its goal is to provide a familiar programming experience to native Bangla speakers, while still supporting typical programming constructs like variables, functions, arrays, objects, loops, and more.\n\n---\n\n## Table of Contents\n\n- [Borno Programming Language](#borno-programming-language)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Installation](#installation)\n  - [How Borno Works](#how-borno-works)\n  - [Usage](#usage)\n  - [Core Grammar](#core-grammar)\n  - [Keywords \\\u0026 Reserved Words](#keywords--reserved-words)\n  - [Examples](#examples)\n    - [Native Library Demo](#native-library-demo)\n    - [Array \\\u0026 Object Demo](#array--object-demo)\n    - [Control Flow Demo](#control-flow-demo)\n    - [Closures \\\u0026 Functions](#closures--functions)\n\n---\n\n## Features\n\n- **Bangla Keywords**: Write if-statements, loops, and function declarations in Bangla.\n- **Arrays \u0026 Objects**: Use `[ ]` and `{ }` for arrays and objects, respectively.\n- **Functions**: Define custom functions with parameters, closures, and return statements.\n- **Built-In Functions**: Access native functions like input, array manipulation (append, remove), math utilities (sqrt, abs, sin, etc.).\n- **Bangla Digits**: Parse and convert Bangla digits (০, ১, ২, ৩, ...) to ASCII under the hood.\n\n---\n\n## Installation\n\n1. **Clone the Repository**:\n\n   ```bash\n   git clone https://github.com/ah-naf/borno.git\n   cd borno\n   ```\n\n2. **Build** (assuming you have Go installed):\n\n   ```bash\n   go build -o borno\n   ```\n\n   This produces an executable named `borno`.\n\n---\n\n## How Borno Works\n\nBorno follows a **three-phase** process:\n\n1. **Lexical Analysis (Lexer)**  \n   The source code (in `.bn` files) is scanned character-by-character to produce **tokens**. For instance, `ধরি`, `ফাংশন`, `যদি`, etc., are recognized as **Bangla keywords**, while identifiers and operators are tokenized accordingly.\n\n2. **Parsing (Parser)**  \n   The tokens are read according to Borno’s **grammar rules**, building an **Abstract Syntax Tree** (AST). This phase checks syntax (e.g., matching parentheses, valid expressions).\n\n3. **Interpretation**  \n   The AST is **walked** by an **interpreter**, which executes each statement and expression. There are native functions (e.g., `ইনপুট`, `লেন`, `এড`) that integrate Go-based capabilities (like reading from stdin or calculating math functions).\n\nWhen you run a Borno script, these steps occur behind the scenes. Any errors (syntax or runtime) are displayed in Bangla or Banglish messages.\n\n---\n\n## Usage\n\nOnce you’ve built the `borno` executable:\n\n1. **Run a Borno Script**:\n\n   ```bash\n   ./borno my_script.bn\n   ```\n\n2. **Interactive Mode (REPL)**:\n   If you run `./borno` with no file arguments, you can type code line by line. This is useful for quick tests or demos.\n\n3. **Examples**:\n   Check out the `examples/` directory (or see below) for `.bn` files demonstrating language features.\n\n**File Extension**: We recommend using `.bn` (short for “Borno”) for all source files.\n\n---\n\n## Core Grammar\n\nBelow is a **simplified** version of Borno’s grammar:\n\n```\nprogram        → declaration* EOF ;\n\ndeclaration    → funDecl\n               | varDecl\n               | statement ;\n\nfunDecl        → \"ফাংশন\" function ;\nfunction       → IDENTIFIER \"(\" parameters? \")\" block ;\nparameters     → IDENTIFIER ( \",\" IDENTIFIER )* ;\n\nvarDecl        → \"ধরি\" variable ( \",\" variable )* \";\" ;\nvariable       → IDENTIFIER ( \"=\" expression)? ;\n\nstatement      → exprStmt\n               | ifStmt\n               | whileStmt\n               | forStmt\n               | printStmt\n               | block\n               | breakStmt\n               | continueStmt\n               | returnStmt ;\n\nifStmt         → \"যদি\" \"(\" expression \")\" statement ( \"নাহয়\" statement )? ;\nwhileStmt      → \"যতক্ষণ\" \"(\" expression \")\" statement ;\nforStmt        → \"ফর\" \"(\" ( varDecl | exprStmt | \";\" ) expression? \";\" expression? \")\" statement ;\nexprStmt       → expression \";\" ;\nprintStmt      → \"দেখাও\" expression \";\" ;\nblock          → \"{\" declaration* \"}\" ;\nbreakStmt      → \"থামো\" \";\" ;\ncontinueStmt   → \"চালিয়ে_যাও\" \";\" ;\nreturnStmt     → \"ফেরত\" expression? \";\" ;\n\nexpression     → assignment ;\nassignment     → IDENTIFIER \"=\" assignment | logic_or ;\n\nlogic_or       → logic_and ( ( \"বা\" | \"||\" ) logic_and )* ;\nlogic_and      → equality ( ( \"এবং\" | \"\u0026\u0026\" ) equality )* ;\nequality       → comparison ( ( \"!=\" | \"==\" ) comparison )* ;\ncomparison     → term ( ( \"\u003e\" | \"\u003e=\" | \"\u003c\" | \"\u003c=\" ) term )* ;\nterm           → factor ( ( \"-\" | \"+\" ) factor )* ;\nfactor         → power ( ( \"/\" | \"*\" | \"%\" ) power )* ;\npower          → unary ( ( \"**\" ) unary )* ;\nunary          → ( \"!\" | \"-\" | \"~\" ) unary | primary ;\nprimary        → NUMBER | STRING | \"সত্য\" | \"মিথ্যা\" | \"nil\" | \"(\" expression \")\" | IDENTIFIER\n               | arrayLiteral | objectLiteral ;\n\narrayLiteral   → \"[\" ( expression ( \",\" expression )* )? \"]\" ;\nobjectLiteral  → \"{\" ( property ( \",\" property )* )? \"}\" ;\nproperty       → IDENTIFIER \":\" expression ;\n```\n\n---\n\n## Keywords \u0026 Reserved Words\n\nHere are the **Bangla keywords** Borno uses:\n\n| Keyword         | Description                |\n|-----------------|----------------------------|\n| `ফাংশন`         | Declares a function.      |\n| `ধরি`           | Declares a variable.      |\n| `ফর`            | For-loop.                 |\n| `যদি`           | If-statement.             |\n| `নাহয়`          | Else-statement.           |\n| `যতক্ষণ`       | While-loop.               |\n| `সত্য`          | Boolean true.             |\n| `মিথ্যা`        | Boolean false.            |\n| `দেখাও`         | Print statement.          |\n| `ফেরত`          | Return from function.     |\n| `থামো`          | Break from loop.          |\n| `চালিয়ে_যাও`    | Continue loop.            |\n| `এবং`           | Logical AND (\u0026\u0026).         |\n| `বা`            | Logical OR (\u0026#124;\u0026#124;).|\n\nReserved identifiers like `ক্লক`, `ইনপুট`, `এড`, `রিমুভ`, etc., are bound to **native functions** in the global environment.\n\n---\n\n## Examples\n\nBelow are a few snippet examples to illustrate various features of Borno.\n\n### Native Library Demo\n\nSave this code as **`native_library_demo.bn`** and run `borno native_library_demo.bn`:\n\n```none\n// 1) ক্লক (clock) \n//    Shows the current timestamp in seconds.\nদেখাও \"বর্তমান সময় (সেকেন্ডে): \" + ক্লক();\n\n// 2) ইনপুট (input) \n//    Uncomment these lines to test user input interactively.\n// দেখাও \"কিছু লিখুনঃ\"\nধরি প্রবেশ = ইনপুট(\"আপনার লেখা: \");\nদেখাও \"আপনি লিখেছেনঃ \" + প্রবেশ;\n\n// 3) লেন (len)\n//    Returns the length of an array.\nধরি তালিকা = [১০, ২০, ৩০];\nদেখাও লেন(তালিকা);\n\n// 4) এড (append)\n//    Appends one or more elements to the array.\nতালিকা = এড(তালিকা, ৪০);\nদেখাও তালিকা;\n\n// 5) রিমুভ (remove)\n//    Removes an element from the array at a given index.\nতালিকা = রিমুভ(তালিকা, ১);\nদেখাও তালিকা;\n\n// 6) কি_রিমুভ (delete)\n//    Deletes a property from an object by key.\nধরি বস্তু = {\n    নাম: \"বর্ণলিপি\",\n    ধরন: \"ডেমো\",\n    মান: ৫\n};\nদেখাও বস্তু;\nকি_রিমুভ(বস্তু, \"মান\");\nদেখাও বস্তু;\n\n// 7) অব্জেক্ট_কি (keys) এবং অব্জেক্ট_মান (values)\n//    Gets arrays of keys or values from an object.\nদেখাও অব্জেক্ট_কি(বস্তু);\nদেখাও অব্জেক্ট_মান(বস্তু);\n\n// 8) পরমমান (abs)\n//    Returns the absolute value of a number.\nদেখাও \"পরমমান(-১২.৫): \" + পরমমান(-১২.৫);\n\n// 9) বর্গমূল (sqrt)\n//    Computes the square root of a number.\nদেখাও \"বর্গমূল(১৬): \" + বর্গমূল(১৬);\n\n// 10) ঘাত (pow)\n//     Raises the first number to the power of the second.\nদেখাও \"ঘাত(২, ৮): \" + ঘাত(২, ৮);\n\n// 11) সাইন (sin), কসাইন (cos), ট্যান (tan)\n//     Common trigonometric functions in radians.\nদেখাও \"সাইন(৩.১৪/২) =\u003e \" + সাইন(৩.১৪ / ২);\nদেখাও \"কসাইন(০) =\u003e \" + কসাইন(০);\nদেখাও \"ট্যান(৩.১৪/৪) =\u003e \" + ট্যান(৩.১৪ / ৪);\n\n// 12) সর্বনিম্ন (min), সর্বোচ্চ (max)\n//     Returns the smallest/largest value among the given numbers.\nদেখাও \"সর্বনিম্ন(১০, ৫, -৩, ৮) =\u003e \" + সর্বনিম্ন(১০, ৫, -৩, ৮);\nদেখাও \"সর্বোচ্চ(১০, ৫, -৩, ৮) =\u003e \" + সর্বোচ্চ(১০, ৫, -৩, ৮);\n\n// 13) রাউন্ড (round)\n//     Rounds a floating-point number to the nearest integer.\nদেখাও \"রাউন্ড(৩.৬৭) =\u003e \" + রাউন্ড(৩.৬৭);\n\n```\n\nAnd so on. This snippet demonstrates user input, array functions, object manipulation, etc.\n\n---\n\n### Array \u0026 Object Demo\n\n```none\nফাংশন testArrayAndObject() {\n    ধরি arr = [10, 20, 30];\n    দেখাও \"First element of arr: \" + arr[0];\n    arr[2] = 300;\n    দেখাও \"Modified third element of arr: \" + arr[2];\n\n    ধরি obj = {\n        name: \"Borno Language\",\n        count: 1\n    };\n    দেখাও \"Object name property: \" + obj.name;\n    obj.count = obj.count + 1;\n    দেখাও \"Updated count property: \" + obj.count;\n\n    ফেরত obj;\n}\n\nধরি result = testArrayAndObject();\nদেখাও \"Returned object count: \" + result.count;\n```\n\n---\n\n### Control Flow Demo\n\n```none\n// If-Else\nধরি x = 15;\nযদি (x \u003e 10) {\n    দেখাও \"x is greater than 10\";\n} নাহয় {\n    দেখাও \"x is 10 or less\";\n}\n\n// For loop with break/continue\nফর (ধরি i = 0; i \u003c 5; i = i + 1) {\n    যদি (i == 2) {\n        দেখাও \"Skipping i = 2\";\n        চালিয়ে_যাও;\n    }\n    যদি (i == 4) {\n        দেখাও \"Breaking at i = 4\";\n        থামো;\n    }\n    দেখাও i;\n}\n\n// While loop\nধরি count = 0;\nযতক্ষণ (count \u003c 3) {\n    দেখাও \"Count = \" + count;\n    count = count + 1;\n}\n```\n\n---\n\n### Closures \u0026 Functions\n\n```none\nফাংশন createCounter() {\n    ধরি counter = 0;\n\n    ফাংশন increment() {\n        counter = counter + 1;\n        দেখাও \"Counter = \" + counter;\n    }\n\n    ফেরত increment;\n}\n\nধরি counter1 = createCounter();\ncounter1(); // Counter = 1\ncounter1(); // Counter = 2\ncounter1(); // Counter = 3\n```\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fah-naf%2Fborno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fah-naf%2Fborno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fah-naf%2Fborno/lists"}