Inspiration
Programming languages come in all shapes and sizes, but most share one thing in common: their syntax is overwhelmingly English-based. Mapping English to higher level logical constructs in computing really helped me grasp complex concepts. What if you aren't a native English speaker though? That got me interested in a simple question which led to the birth of Tiny Language: What if you could write code in Hindi?
Tiny Language was inspired by the world of esoteric programming languages, where programming becomes an opportunity to experiment with language, creativity, and unconventional ideas. Projects like LOLCODE, Piet, emojicode, and TrumpScript demonstrate that programming languages don't necessarily have to follow conventional rules.
The idea was to build a small but functional programming language that supports Hindi keywords alongside English ones, without sacrificing the familiar constructs found in conventional programming languages.
Beyond the novelty, the project also explores the potential for making programming more approachable to people who are more comfortable with languages other than English.
What it does
Tiny Language is a Java-based interpreted programming language built using ANTLR4. It originally started as a subset of JavaScript and supports many of the features you'd expect from a conventional programming language.
These include:
- Variables and arithmetic operations
- Boolean expressions and comparisons
- Conditional statements (if and else)
- Iteration using while and for loops
- Arrays, lists, and matrices
- User-defined functions
- File input/output
- Built-in functions with Hindi and English equivalents
For example, the language supports Hindi alternatives to common built-in functions, such as प्रिंटलाइन for println, इनपुट for input, and माप for size.
Tiny Language is designed to support general-purpose computation rather than being limited to printing messages or evaluating simple expressions.
I also developed a Visual Studio Code extension to provide a more complete programming environment for the language. The extension brings syntax highlighting, autocorrection, and debugging tools into VS Code, making Tiny Language more convenient to write, execute, and experiment with.
The project is split into two open-source repositories:
- Tiny Language — Interpreter
- Tiny Language — VS Code Extension
However, the VS Code plugin contains everything needed to run programs in this language and it turns VS Code into a full fledged IDE for this language.
How we built it
The language is implemented in Java, using ANTLR4 (ANother Tool for Language Recognition) to define and parse its syntax.
ANTLR4 provides the tools for transforming source code into a structured representation that the interpreter can evaluate. This made it possible to concentrate on the language's behavior and execution logic rather than writing an entire parser from scratch.
The language design was informed by The Definitive ANTLR 4 Reference and Bart Kiers' Tiny ANTLR4 Language project.
The interpreter implements familiar programming constructs, including expressions, control flow, functions, and data structures. Hindi-language support is incorporated into the language's syntax and built-in functions.
The second part of the project was developing a VS Code extension. This involved integrating Tiny Language with the editor to provide syntax highlighting, editing assistance, and debugging capabilities.
Together, these components turn a standalone language interpreter into a more practical programming environment.
Challenges we ran into
One of the central challenges of building a programming language is making the different components work together: the grammar, parser, interpreter, and runtime behavior all need to agree on what constitutes a valid program.
Supporting Hindi also introduces an interesting language-design consideration. Programming languages typically assume English keywords, but there's no fundamental reason they must be English. Accommodating Devanagari script requires careful handling of Unicode text and language tokens.
Another challenge is the tooling surrounding the language. Creating an interpreter is one thing; making it pleasant to use is another. Developing the VS Code extension meant addressing the editor experience in addition to the language implementation itself.
Accomplishments that we're proud of
The biggest accomplishment is taking an unconventional programming-language idea and developing it into a functional project with its own development tools.
I'm particularly proud of:
- Hindi and English support: Demonstrating that familiar programming constructs can coexist with Hindi-language syntax.
- A functional interpreter: Supporting variables, functions, control flow, collections, and file operations.
- VS Code integration: Building dedicated tooling rather than requiring users to work exclusively through a command-line interpreter.
- Open-source development: Publishing both the interpreter and editor extension so others can explore the implementation and build upon it.
What began as an experiment inspired by esoteric languages has grown into something with potential educational and accessibility applications.
What we learned
Building Tiny Language provided an opportunity to explore how programming languages work beneath the surface.
Using ANTLR4 helped develop a deeper understanding of grammars, parsing, language structure, and the relationship between source code and execution.
The project also reinforced an important distinction: building a programming language and building a usable programming environment are two different challenges.
A language needs more than a parser and interpreter to feel approachable. Editor support, error feedback, and debugging tools all contribute to the experience.
Perhaps the most interesting takeaway is that programming-language syntax is a design choice. English keywords are a convention, not a technical necessity. Experimenting with Hindi opens up questions about localization, accessibility, and how programming might be taught to different audiences.
What's next for Tiny Language!
There are several directions I'd like to explore as the project develops.
Support for additional spoken languages: Extend the grammar to support keywords and syntax from other languages, making Tiny Language a platform for experimenting with multilingual programming.
GUI library: Introduce graphical interface capabilities so programs can create windows and interactive applications rather than being limited primarily to console-based execution.
Networking features: Add networking functionality to support communication between programs and enable more sophisticated applications.
Continued IDE development: Improve the VS Code extension and expand the tools available for writing, running, and debugging Tiny Language programs.
Ultimately, Tiny Language is both a programming-language experiment and an exploration of how programming can become more accessible, expressive, and linguistically diverse.
Log in or sign up for Devpost to join the conversation.