Skip to content

iskandervdh/vorn

Repository files navigation

vorn

vorn is a simple interpreted C-like scripting language I made to learn more about language design and implementation.

Features

  • 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

Planned features

  • Ternaries
  • Error handling
  • Modules/Namespaces/Importing
  • Standard library
  • Code formatter/Linter

Example

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.

Building

To build vorn, you need to have Go installed. Then, run the following command:

go build

Running

To run vorn, you can either run the executable directly or use the REPL. To run the REPL, run the following command:

./vorn

To run a script, run the following command:

./vorn path/to/script.vorn

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

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.

About

A simple interpreted C-like scripting language.

Topics

Resources

License

Stars

Watchers

Forks