| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Vendetta - experimental programming language with the goal of achieving self-hosting capability.
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.vendThis 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.
| Back | FazBrowse Home | New Git URL |