Tiny-Lang Interpreter

Python Interpreter from Scratch

A tiny interpreter implementing lexing, parsing (AST), and evaluation. Built to strengthen language fundamentals and clean architecture.

Quick Facts

What It Does

Tiny-Lang reads source code, converts it into tokens (lexer), builds an abstract syntax tree (parser), then evaluates the AST to produce a result (interpreter).

Goal: Build a clean, modular interpreter that is easy to extend with new syntax.

Architecture

This project is organized as small modules that match each stage of interpretation:

Lexer

Turns raw characters into tokens (identifiers, numbers, operators, keywords).

Parser

Consumes tokens and builds an AST using a clear, readable parsing strategy.

AST

Node structures representing expressions/statements, used by the evaluator.

Evaluator

Walks the AST and executes logic, producing values and handling errors.

Current Features

In Progress

Planned

How to Run

  1. Clone the repository.
  2. git clone https://github.com/lizziejperez/Tiny-Lang-Interpreter.git
    cd Tiny-Lang-Interpreter
  3. Create/activate a virtual environment.
  4. python -m venv .venv
    
    # Windows PowerShell:
    .venv\Scripts\activate
    
    # macOS/Linux:
    source .venv/bin/activate
  5. Install (editable) and run a sample program.
  6. pip install -e .
    
    # Example run (update to your entrypoint):
    python -m tinylang

Note: Update the command above to match your current entrypoint once you finalize it.

Design Notes

Next Steps