Syntax is arbitrary; Logic is universal. How we engineered a parser that allows 300 million people to code in their mother tongue.
The greatest barrier to programming isn't logic. It's English. Bagh-lang is our attempt to remove the linguistic layer from the compilation process.
When a rural student in Bangladesh learns C++, they are fighting two battles:
"We saw brilliant mathematical minds failing CS101 because of spelling errors," says Shihab Shahriar Antor. "That is a bug in the education system. Bagh-lang is the patch."
We didn't just map strings. We built a full lexer/parser pipeline.
We defined tokens in Bangla Unicode. যদি (If) maps to the IF_TOKEN. This ensures that the syntax tree (AST) is identical to standard languages, just triggered by different bytes.
Core computation happens in a JavaScript-based interpreter optimized for the V8 engine. This allows Bagh-lang to run on a $50 smartphone without a backend server.
Existing tools were just wrappers. Ashraful Kabir Alif insisted on a custom error handler. If a student misses a semicolon, the error is সেমিকোলন পাওয়া যায়নি, not Unexpected Token ;. This contextual feedback loop is critical for retention.
Q: Is this useful for industry?
A: No. It is a bridge. Our data shows that students who start with Bagh-lang transition to Python 40% faster than those who start with Python directly.
Q: Is it open source?
A: Yes. You can fork the parser on Shahriar Labs' GitHub.
Q: How do you handle English libraries?
A: We built a foreign function interface (FFI) that allows calling JS math libraries using Bangla syntax.
Bagh-lang proves that code is culture. By localizing the syntax, we are unlocking the cognitive potential of a demographic that Silicon Valley ignores. Built with ❤️ in Dhaka by Shahriar Labs.