Logo Lanfrica

ybn2001/borno-lang

Type de record:

software
Créateur:
ybn
Hôte:
# Borno (বর্ণ) Borno is a small programming language I made for my compiler course using Flex and Bison. The keywords are Bengali words written in English letters, and the file extension is `.brn`. ``` dhori naam = nao("Tomar naam ki? "); dekhao("Shagotom,", naam + "!"); ``` ## Why the name "Borno"? "Borno" (বর্ণ) means a letter of the alphabet in Bengali. I chose it for three reasons: 1. Every program, no matter how big, is just borno — plain characters arranged by rules. In fact the very first stage of my interpreter (the Flex lexer) literally reads the source file one character at a time and groups the characters into tokens. So the name describes exactly where the whole pipeline starts. 2. In Bangladesh, "bornomala" (the alphabet) is the first thing we ever learn as kids. Borno is meant the same way — a first, simple language for learning how programming languages actually work. 3. The keywords themselves are Bengali words (dhori, dekhao, jodi...), so a Bengali name for a Bengali-flavored language felt right. ## What it can do The required stuff: - Variables: `dhori x = 5;` to declare, `x = x + 1;` to change - Arithmetic: `+ - * /` and comparisons `> = <= == !=` - If/else: `jodi (...) { } nahole { }` - Loops: `jotokkhon` (while) and `chokro` (for) - Output with `dekhao(...)` and input with `nao("prompt")` Extra things I added on top: - Strings as a real type. `+` joins strings, and even joins a string with a number ("mark: " + 90 gives "mark: 90") - `nao()` is smart — if you type 42 it gives you the number 42, if you type your name it gives you a string - `%` (remainder) and `^` (power) operators - Booleans `sotti` / `mittha` and logical `ebong` / `ba` / `na` with short-circuit - else-if by chaining `nahole jodi` - Small built-in functions: `borgomul(x)` for square root, `poromman(x)` for absolute value, `dorgho(s)` for string length - Comments with `#` or `//` - Error messages with line numbers instead of just crashing ## How I built it There are t …