Skip to content

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.

License

Notifications You must be signed in to change notification settings

isaachraga/Custom-Interpreted-Programming-Language

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom Interpreted Programming Language

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.

Overview

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.


Demo

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
}

Skills Demonstrated

  • 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

Architecture

The language is structured as a modular interpreter pipeline:

Tokenizer

Converts source code into tokens (keywords, operators, literals, identifiers).

Parser

Consumes tokens and produces an Abstract Syntax Tree (AST).

Evaluator

Walks the AST to evaluate expressions and statements.

Runner

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.

How to Run

Prerequisites

  • Python 3.9 or later

Setup

Run the REPL

  • python runner.py

Language Features

  • Integer arithmetic (+, -, *, /, %)
  • Comparison operators (>, <, ==)
  • Variable assignment
  • Conditional statements
  • Built-in print function
  • Persistent execution environment within the REPL

Technologies Used

  • Python 3
  • Standard library only (no external dependencies)

Contact

Isaac Hraga

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published