Vendetta - experimental programming language with the goal of achieving self-hosting capability.
- Stage: Bootstrap (Python interpreter)
- Self-hosting: In development
- Stability: Experimental
- Basic syntax
- Variable declarations
- Control flow (if/else, loops)
- Functions
- Arithmetic operations
- String operations
- Boolean logic
- Comments
- Compilation
- Self-hosting
- Standard library
git clone https://github.com/yourusername/vendetta.git
cd vendetta
python3 interpreter/interpreter.py examples/hello.vendCreate a file hello.vend:
# Hello World in Vendetta
echo "Hello, Vendetta!"
Run it:
python3 interpreter/interpreter.py hello.vendVariables are declared using the mask keyword:
mask name = "Vendetta"
mask age = 25
mask pi = 3.14159
mask is_active = true
mask x = 10
mask y = 20
mask sum = x + y
mask product = x * y
mask is_equal = x == y
mask score = 85
if score >= 90 {
echo "Excellent!"
} else if score >= 70 {
echo "Good job!"
} else {
echo "Keep trying!"
}
mask counter = 0
loop counter < 5 {
echo "Count: " + counter
counter = counter + 1
}
function greet(name) {
echo "Hello, " + name + "!"
}
function add(a, b) {
return a + b
}
# Call functions
greet("Alice")
mask result = add(5, 3)
echo "5 + 3 = " + result
# This is a single line comment
# Multi-line
# comments
# are supported
# arithmetic.vend
mask a = 10
mask b = 5
mask sum = a + b
mask diff = a - b
mask prod = a * b
mask quot = a / b
echo "Sum: " + sum
echo "Difference: " + diff
echo "Product: " + prod
echo "Quotient: " + quot
# logic.vend
mask x = 10
mask y = 20
mask is_greater = x > y
mask is_equal = x == y
mask is_not_equal = x != y
if is_greater {
echo "x is greater than y"
} else {
echo "x is not greater than y"
}
# strings.vend
mask first_name = "John"
mask last_name = "Doe"
mask full_name = first_name + " " + last_name
echo "Full name: " + full_name
# recursion.vend
function factorial(n) {
if n <= 1 {
return 1
} else {
return n * factorial(n - 1)
}
}
mask result = factorial(5)
echo "5! = " + result
# calculator.vend
function calculate(a, op, b) {
if op == "+" {
return a + b
} else if op == "-" {
return a - b
} else if op == "*" {
return a * b
} else if op == "/" {
return a / b
} else {
echo "Unknown operator: " + op
return 0
}
}
mask x = 15
mask y = 3
echo "15 + 3 = " + calculate(x, "+", y)
echo "15 - 3 = " + calculate(x, "-", y)
echo "15 * 3 = " + calculate(x, "*", y)
echo "15 / 3 = " + calculate(x, "/", y)
vendetta/
|-- interpreter/
| `-- interpreter.py # Main interpreter entry point
|-- core/
| |-- lexer.py # Lexical analyzer
| |-- parser.py # Syntax parser
| |-- ast.py # Abstract Syntax Tree
| `-- interpreter.py # AST interpreter
|-- examples/
| |-- hello.vend # Hello World example
| |-- arithmetic.vend # Arithmetic operations
| |-- logic.vend # Logic operations
| |-- strings.vend # String operations
| |-- recursion.vend # Recursive functions
| `-- calculator.vend # Simple calculator
|-- docs/
| `-- syntax.md # Complete syntax reference
|-- README.md # This file
|-- .gitignore # Git ignore file
`-- LICENSE # MIT License
# Run all examples
python3 interpreter/interpreter.py examples/hello.vend
python3 interpreter/interpreter.py examples/arithmetic.vend
python3 interpreter/interpreter.py examples/logic.vend
python3 interpreter/interpreter.py examples/strings.vend
python3 interpreter/interpreter.py examples/recursion.vend
python3 interpreter/interpreter.py examples/calculator.vendpython3 interpreter/interpreter.py --debug examples/hello.vend- Basic syntax and semantics
- Variable declarations
- Control flow
- Functions
- Built-in operations
- Arrays and data structures
- Error handling
- Module system
- Standard library
- Bytecode generation
- Virtual machine
- Optimization passes
- Compiler written in Vendetta
- Bootstrap process
- Complete self-compilation
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Vendetta aims to demonstrate that a programming language can achieve self-hosting - the ability to compile itself using itself. This is a significant milestone in language design that few languages achieve.
The name "Vendetta" represents the language's relentless pursuit of independence and self-sufficiency, breaking free from dependence on external tools and compilers.
- Inspired by classic self-hosting languages like C, Rust, and Go
- Built with modern Python practices
- Community-driven development