A simple interpreted programming language implemented in Python, featuring a lexer, parser, compiler, and virtual machine.
OilLang is an educational programming language that demonstrates the core components of language implementation:
- Lexer: Converts source code into tokens
- Parser: Builds an Abstract Syntax Tree (AST) from tokens
- Compiler: Transforms AST into bytecode
- Virtual Machine: Executes the compiled bytecode
- Variables:
x = 5; - Arithmetic Operations:
+,-,*,/ - Comparison Operations:
==,!=,<,<=,>,>= - Logical Operations:
&&,||,! - Compound Assignments:
+=,-=,*=,/= - Control Structures:
ifandwhile - Output:
printstatements - Comments: Single-line comments with
//
// Basic arithmetic and variables
x = 10;
y = 5;
result = x * y + 2;
print result;
// Conditional statements
if (x > y) {
print "x is greater";
} else {
print "y is greater or equal";
}
// While loop
counter = 0;
while (counter < 5) {
print counter;
counter += 1;
}
git clone https://github.com/RaitonRed/oillang.git
cd oillangpython main.pypython main.py program.oil- Add support for string literals
- Implement arrays/lists
- Add functions and return statements
- Support for floating-point numbers
- Add modulo operator (
%)
- Better error messages with line numbers and suggestions
- Syntax highlighting for editors
- Debug mode with step-by-step execution
- Bytecode disassembler
- Profiling and optimization tools
- Standard library functions (I/O, math, etc.)
- Import system for modular code
- Basic type system
- Garbage collection
- JIT compilation
- Package manager for libraries
- Language server protocol support
- Web-based playground
- Comprehensive documentation
- Performance benchmarking suite
Contributions are welcome! Please feel free to submit pull requests for:
- Bug fixes
- New language features
- Performance improvements
- Additional test cases
- Documentation enhancements
This project is open source and available under the MIT License.