README.md for FastLang
FastLang is a simple, stack-based programming language built in Python.
It converts source code (.fl files) into bytecode which runs on a lightweight Virtual Machine (VM).
- Stack-based execution for fast and efficient operations
- Supports integers, variables, basic arithmetic, and print statements
- Easily extendable for loops, conditions, and more
- Minimal and clean design for learning language development
FastLang/ β βββ src/ β βββ lexer.py # Tokenizer (for future extensions) β βββ compiler.py # Converts FastLang code β bytecode β βββ bytecode.py # VM instruction set β βββ vm.py # Virtual Machine β βββ init.py β βββ examples/ β βββ test.fl # Example FastLang program β βββ main.py # Entry point to run programs βββ README.md # Project documentation βββ requirements.txt # No external dependencies βββ .vscode/ βββ launch.json # VS Code run configuration
- Make sure Python 3.9+ is installed.
- Run the example bytecode in
main.py:
python main.py
To run a .fl program:
from src.compiler import Compiler
from src.vm import VirtualMachine
compiler = Compiler()
bytecode = compiler.compile("examples/test.fl")
vm = VirtualMachine()
vm.run(bytecode)
βοΈ Example .fl Program
let x = 10
let y = 5
print x + y
Output:
15
β‘ Efficiency
Stack-based operations for fast execution
Minimal runtime overhead
Easy to extend with new instructions
π οΈ Future Work
Add loops and conditionals
Add functions and reusable code
Syntax highlighting support
Error handling improvements