A Python-based interpreted programming language built to demonstrate language design fundamentals, including tokenization, parsing, evaluation, and execution, with a fully interactive REPL for terminal-based execution.
This project is a custom programming language implemented in Python, featuring a complete interpreter pipeline and an interactive REPL (Read–Eval–Print Loop). It was built to demonstrate a clear understanding of:
- Language parsing and grammar design
- Abstract Syntax Trees (AST)
- Expression evaluation
- Runtime execution environments
- Interactive language tooling via a REPL
The REPL allows users to write and execute statements directly in the terminal, showcasing arithmetic, logical operations, variables, and control flow in real time.
Example REPL session:
print 1+2+3; // 6
print 4+-4; // 0
print 3 > 4; // false
print 3 % 2; // 1
homework = 1;
if (homework == 1) {
testEnv;
print(_id_); // username@email.com
}
- Python language design
- Recursive descent parsing
- Tokenization and lexical analysis
- Abstract Syntax Tree construction
- Expression evaluation
- Runtime environments and variable scope
- Interactive REPL implementation
- Debugging language-level errors
The language is structured as a modular interpreter pipeline:
Converts source code into tokens (keywords, operators, literals, identifiers).
Consumes tokens and produces an Abstract Syntax Tree (AST).
Walks the AST to evaluate expressions and statements.
Manages execution flow, environment state, control structures, and the REPL, which provides an interactive terminal interface that continuously reads input, evaluates it, and prints results.
- Python 3.9 or later
- git clone https://github.com/isaachraga/Custom-Interpreted-Programming-Language.git
- cd Custom-Interpreted-Programming-Language
- python runner.py
- Integer arithmetic (+, -, *, /, %)
- Comparison operators (>, <, ==)
- Variable assignment
- Conditional statements
- Built-in print function
- Persistent execution environment within the REPL
- Python 3
- Standard library only (no external dependencies)
Isaac Hraga
- GitHub: https://github.com/isaachraga
- LinkedIn: www.linkedin.com/in/isaac-hraga-5b7535b2