Skip to content

Repository files navigation

Squig Banner

⚡ Squig Programming Language ⚡

A custom programming language built with Python to explore how interpreters and programming languages work internally.


✨ About

Squig is an educational programming language built from scratch using Python.
The project focuses on understanding the internals of language design and interpreter implementation.

It explores concepts like:

  • 🔹 Tokenization (Lexer)
  • 🔹 Parsing
  • 🔹 Abstract Syntax Trees (AST)
  • 🔹 Interpreters & Execution Engines
  • 🔹 Variables and Expressions
  • 🔹 Functions & Scope Handling
  • 🔹 Runtime Environments
  • 🔹 Error Reporting

This is not intended to be a production-ready language.
It is a learning-focused project for experimenting with compiler and interpreter design.


🚀 Features

  • ✅ Custom language syntax
  • ✅ Lexer implementation
  • ✅ Parser implementation
  • ✅ AST generation
  • ✅ Expression evaluation
  • ✅ Variables and assignments
  • ✅ Error diagnostics
  • ✅ CLI execution support
  • ✅ Modular architecture

📁 Project Structure

squig/
│
├── Lexer.py          # Converts source code into tokens
├── Parser.py         # Builds AST from tokens
├── Interpreter.py    # Executes AST nodes
├── squig.py          # CLI tool to run Squig programs
├── scripts/          # Built-in libraries
├── tests/            # Unit tests
└── README.md

💻 Example

>>> let x : 10  # assign value 10 to 'x'
>>> let y : 20  # assign value 20 to 'y'
>>> log x + y   # print result

Output

30

🎯 Learning Goals

This project is focused on learning:

  • 🧠 How interpreters work internally
  • 🧠 Parsing techniques
  • 🧠 Language design principles
  • 🧠 AST traversal
  • 🧠 Scope and symbol tables
  • 🧠 Runtime execution models
  • 🧠 Error diagnostics

👨‍💻 Contributors

Harish
Harish
Madhan Kumar
Madhan Kumar

🛣️ Roadmap

Planned features:

  • Better parser error messages
  • Functions
  • Loops and conditionals
  • Standard library support
  • Bytecode compiler
  • Virtual Machine implementation
  • Garbage collection experiments

📜 License

This project is open-source and available under the MIT License.


⚠️ Note

This repository is mainly for educational purposes and experimentation.

Expect:

  • Frequent changes
  • Experimental features
  • Broken implementations
  • Lots of learning 🚀

About

Programming language

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages