Work / WiseLang

2025 · Open source

WiseLang

A Python-inspired esoteric programming language with Hindi keywords.

WiseLang reads like Python and speaks Hindi. Variables are declared with WTF, output goes through eww, and control flow uses agar and nahi toh. It was built for a group of people learning to code, which is a good reason for a language to exist and a better one than most esolangs have.

It is not a toy parser. There is a real lexer, a real parser and a real evaluator underneath, and my part of the co-development was the language-processing pipeline: taking text apart and handing something back that runs.

Stack

Language
Python
Lexing & parsing
SLY
Stages
Lexical analysis · Parsing · Evaluation
Execution
Interactive REPL · File execution

The pipeline

Source text goes through lexical analysis to produce a stream of tokens, the parser turns that stream into a syntax tree, and the evaluator walks the tree to execute it. The three stages are separate, which is what makes the thing debuggable at all: when something goes wrong you can ask which stage lost the plot.

Lexing and parsing are built on SLY, the Python lexer and parser library. SLY was written by the author of PLY and has a nice property for a teaching language: the grammar in the source looks like grammar notation, so the parser is close to readable on its own.

Syntax

Custom syntax, interactive execution, file execution, and the core control-flow constructs. You can run it against a file or drop into a REPL and type at it, and there is a debug switch for looking at what the pipeline is doing.

The Hindi keyword set is the point of the thing. agar and nahi toh read instantly to anyone who grew up with the language, and that lowers the wall for the exact people the project was aimed at.

Co-developed

This was a team project, not a solo one. I co-developed it and owned the language-processing components; the repository is WiseGrammers/WiseLang.

Real syntax, from the project's README

Comments use //. eww writes a line. WTF declares a variable. agar and nahi toh are if and else. The language runs either a file or an interactive session.

from the project's README

// this is a comment

eww "hello world"        // displays "hello world"

WTF a = 10
WTF b = 20

agar a == 10 {           // if
  eww "a is 10"
}

nahi toh {               // else
  chutiya                // pass
}

Source: the repository README