VisuLang: Interactive MiniLang Compiler
VisuLang is a visual education platform designed to demystify the inner workings of modern compilers. By providing a step-by-step visualization of the compilation pipeline, from Lexical Analysis to Machine Code generation, VisuLang helps students and developers understand how code is transformed and executed.

Live Demo
A web-based interactive playground is available to test the compilation pipeline directly in your browser: Access the VisuLang Web Playground
Key Features
- Live Pipeline Visualization: Observe code as it flows through the Lexer, Parser, Semantic Analyzer, and Code Generator.
- Interactive Playground: Write MiniLang code and view immediate results within the web dashboard.
- AST Exploration: Visualize the Abstract Syntax Tree generated from the source code.
- Machine Code Generation: Observe how high-level logic translates into low-level instructions.
- Integrated Interpreter: Run the code directly in the environment and review the execution trace.
Compilation Pipeline
- Source: Raw MiniLang code input.
- Lexer: Converts source code into a stream of tokens.
- Parser: Builds an Abstract Syntax Tree (AST) following MiniLang grammar.
- Semantic Analysis: Performs type checking and symbol table management.
- IR Generation: Produces Intermediate Representation (3-Address Code).
- Optimizer: Applies constant folding and dead code elimination.
- Machine Code: Lowers IR to simulated target assembly.
- Interpreter: Executes the code and provides program output.
Local Development (Python GUI)
While the web playground provides an accessible overview, the full-featured desktop application offers advanced debugging tools and deeper system integration.
Prerequisites
- Python 3.10+
- PySide6
Setup
# Clone the repository
git clone https://github.com/hadi-mostafa-27/VisuLang-a-visual-compiler-prototype-.git
# Install dependencies
pip install -r requirements.txt
# Run the GUI
python MiniLangCompiler/gui.py
Project Status
This is strictly an educational project developed for academic and learning purposes. It serves as a prototype to demonstrate fundamental compiler construction principles and should not be used in production environments.