vorn is a simple interpreted C-like scripting language I made to learn more about language design and implementation.
- Integers, Floats, Booleans and Strings
- Arithmetic operations
- Logical operators
- Comparison operators
- Variables
- Comments
- Arrays and Object
- If statements
- For and While loops
- Functions
- Built-in functions (See evaluator.go for a complete list)
- Function chaining (See evaluator.go)
- A REPL
- Assignment operators
- Ternaries
- Error handling
- Modules/Namespaces/Importing
- Standard library
- Code formatter/Linter
func fib(n) {
if n <= 1 {
return n;
}
return fib(n - 1) + fib(n - 2);
}
print(fib(10));
This script calculates the 10th number in the Fibonacci sequence, which is 55.
To build vorn, you need to have Go installed. Then, run the following command:
go buildTo run vorn, you can either run the executable directly or use the REPL. To run the REPL, run the following command:
./vornTo run a script, run the following command:
./vorn path/to/script.vornThis project is licensed under the MIT License - see the LICENSE file for details.
This project was started using Writing An Interpreter In Go, a book by Thorsten Ball. I highly recommend it if you're interested in writing your own interpreter.