đ§ Introduction
Iâve been building my own programming language called Exper, written from scratch in Python.
The goal is to understand how interpreters work internally and experiment with language design (functions, loops, expressions, and control flow).
Right now, Exper is already a working mini-language capable of executing real programs.
âïž What Exper can do so far
The language already supports:
Variables
Functions (with default and named parameters)
If / elif / else conditionals
While and for loops
Return, break and continue
String interpolation using {expression}
Lists and basic methods (append, pop, remove, insert)
Console input/output
Expression evaluation (including function calls inside expressions)
đ» Example code in Exper
fn soma(a, b=10) {
return a + b
}
console.log(soma(5))
console.log(soma(5, 20))
console.log(soma(a=7, b=3))
nome = "Callebe"
idade = 12
if (idade > 17) {
console.log("{nome} is an adult.")
} else {
console.log("{nome} is not an adult.")
}
âïž How it works
Exper is interpreted using a custom Python engine that:
Parses line-by-line execution
Evaluates expressions using a safe evaluator
Handles function calls with local scope simulation
Supports nested expression evaluation
Implements control flow using exceptions (break/continue/return)
â ïž Current challenges
This project is still evolving. Some known challenges:
Expression evaluation still relies partially on eval
Function parsing and argument handling is improving
Scope system is currently simulated (not fully isolated)
Error messages are basic and need improvement
String interpolation and edge cases still being refined
đ What I want to improve next
Better parser (possibly AST-based instead of eval)
Real scope system (local/global separation)
Better error handling system
More operators (like XOR, increment, assignment operators)
Structs / objects / macro-like features
Standard library system
đ Final note
This started as a small experiment and turned into a full mini interpreter.
Iâm learning a lot about how programming languages actually work under the hood.
Any feedback on interpreter design, architecture or performance improvements is welcome.
full source code here
Top comments (0)