Skip to content
AKRAmit Kumar Raikwar
All notes
5 min read

Why I wrote a programming language in Hindi

For a lot of students in India, the first wall is vocabulary rather than logic. Notes from building EasyLang.

Language designEdTechOpen source

I have watched students who understand a loop perfectly stall on the word while. They know what repetition is. They can talk the logic through out loud in Hindi and get it right. Then they turn to the keyboard and the English gets in the way.

That gap has nothing to do with logic, and treating it as though it does costs us people who would have been good at this. So I wrote EasyLang: a small interpreted language with Hindi keywords, published on npm, with a browser playground.

Writing it by hand

No parser generator. A hand-written lexer feeds a recursive-descent parser, which produces an AST, and a tree-walking interpreter runs over that. It is more code than a grammar file. I chose it for one reason: error messages.

Generated parsers hand you generated errors. In a teaching language the error path is the primary interface, because beginners spend more time reading errors than reading output. Owning the parser means owning every message it can produce.

Choosing keywords

Vocabulary turned out to be the hard design problem. Most constructs have a formal Sanskritised word and a conversational one. The formal word looks more legitimate in documentation. The conversational word is the one students think in.

A language meant to remove a barrier should not introduce a smaller one on the way in.

I picked conversational every time.

Errors that do not read as failure

In the playground, errors get the same visual treatment as ordinary output. Same type size, no red, no warning triangle. Beginners hit errors constantly, and if each one looks like a crash, what they learn is to be careful around the tool instead of curious about it.

The interpreter core has no platform dependencies, so the npm package and the web playground run identical code. What gets taught is what ships.

Written by Amit Kumar Raikwar, full-stack engineer & product designer in Indore, India.