docs

Roadmap

What's coming next

kemlang-py is a working interpreter - the core language is complete and stable. These are the features on the horizon, roughly in priority order.

planned Actively being designed
in progress Being implemented on a branch
considering Possible but not decided

Functions

plannedkaam / aapo

Functions are the biggest missing piece. Right now every kemlang-py program is a single flat sequence of statements - you can't extract reusable logic without copy-pasting code. Functions let you define named blocks of code, call them with arguments, and return values.

Proposed keywords

kaamdefine a function (from Gujarati for 'work')
aaposeparates name+params from body (from 'give')
dejoreturn a value (from 'give back')

The design goal is to keep the Gujarati flavour. Functions should feel like natural extensions of the existing keyword style, not bolted-on Python syntax. The exact keyword set is still being finalised - open an issue if you have opinions.

Proposed syntax

jsk
kem bhai kaam factorial n aapo { jo n <= 1 { dejo 1 } dejo n * factorial n - 1 } bhai bol factorial 5 aavjo bhai

Assignment operator

planned

Today you reassign a variable by repeating the full declaration form: aa x che 10, then x che x + 1. The '=' shorthand would make mutation cleaner - especially inside loops where reassignment is common. The implementation is small; the design question is whether '=' should replace 'che' entirely or be an alternative.

The current reassignment syntax (x che x + 1) is unambiguous but verbose. An =operator would make loops and mutation-heavy programs much more concise. Open a PR or issue if you want to take this one - the interpreter change is a one-liner in interpreter.py.

Proposed syntax

jsk
kem bhai aa count che 0 farvu { count = count + 1 bhai bol count } jya sudhi count < 5 aavjo bhai

String interpolation

planned${...}

Currently you build strings by concatenating with +, which gets unreadable fast. String interpolation lets you embed expressions directly inside string literals using a ${...} syntax, similar to JavaScript template literals.

Concatenation works but produces clunky code like "kem cho, " + name + "!". Interpolation keeps the string readable as prose. The lexer would need to handle ${...}spans as embedded expressions and emit them as special tokens.

Proposed syntax

jsk
kem bhai aa name che "Sanket" aa score che 95 bhai bol "kem cho, ${name}! Your score is ${score}." aavjo bhai

Arrays / lists

plannedyaadi

kemlang-py has no collection type. Without arrays you can't store a list of values, compute averages, sort things, or model most real-world problems beyond simple scripts. Arrays are the first data structure that would make kemlang-py genuinely useful for more than toy programs.

Proposed keywords / properties

yaadideclare an array (from Gujarati for 'list')
.lakhuarray length property (from 'count')
[i]zero-based index access

Proposed syntax

jsk
kem bhai aa marks che yaadi [85, 92, 78, 90, 88] aa i che 0 aa total che 0 farvu { total che total + marks[i] i che i + 1 } jya sudhi i < marks.lakhu bhai bol "Average: " + total / marks.lakhu aavjo bhai

Maps / dictionaries

plannednaksha

Arrays solve ordered collections; maps solve named ones. A grade tracker, a word-frequency counter, a config store - these all need key-value lookup. Maps would pair naturally with arrays to make kemlang-py capable of handling realistic data-processing programs.

Proposed syntax

jsk
kem bhai aa grades che naksha { "math" : 92, "english" : 87, "science" : 95 } bhai bol "Math grade: " + grades["math"] aavjo bhai

Error handling

plannedbhai sambhal

Right now any runtime error crashes the whole program. A try/catch equivalent would let programs handle invalid input gracefully - especially important for the number-guessing game and grade calculator patterns where user input can be wrong.

Proposed keywords

bhai sambhal'watch out, friend' - the try block
pakad'catch' - handles the error

Proposed syntax

jsk
kem bhai bhai sambhal { aa n che bapu tame bolo bhai bol n * 2 } pakad { bhai bol "Invalid input, please enter a number" } aavjo bhai

For-each loop

consideringdrek mate

Iterating over an array with a manual index counter is verbose and error-prone. A for-each form would be the natural companion to arrays - once arrays land, a for-each becomes the obvious next step.

Proposed syntax

jsk
kem bhai aa nums che yaadi [1, 2, 3, 4, 5] drek mate num aa nums { bhai bol num * num } aavjo bhai

Multi-line strings

considering"""..."""

Single-line strings work for most cases but make it painful to embed formatted text, ASCII art, or large messages. Triple-quote strings (as in Python) would let you include newlines naturally.

Proposed syntax

jsk
kem bhai aa msg che """ kem cho, duniya! This is a multi-line message. """ bhai bol msg aavjo bhai

Help build these features

kemlang-py is a small, readable codebase. The interpreter is ~500 lines across three files - a great size for a first contribution to a real language implementation.

1

Pick a feature

Comment on an existing GitHub issue or open a new one describing what you want to build. We'll discuss the design before you write code.

2

Read the pipeline

Lexer (lexer.py) → Parser (parser.py) → Interpreter (interpreter.py). Most features touch all three. Start by tracing how an existing feature like 'jo' flows through all three files.

3

Add tests first

Write a test in tests/test_exec.py that shows the expected input/output. Then make the test pass. This keeps new features honest.

4

Check quality

ruff check kemlang tests and ruff format --check kemlang tests must both pass before opening a PR.

Questions, proposals, or just want to discuss the language design? Open an issue on GitHub - all design discussion happens in the open.