A walking tree interpreter for the Typhoon programming language.
Typhoon is a dynamically-typed, interpreted language with a syntax similar to C and JavaScript. Here are some basic examples:
var name = "Alice";
var age = 25;
if (age > 18) {
print "You are an adult.";
} else {
print "You are a minor.";
}
var count = 0;
while (count < 5) {
print count;
count = count + 1;
}
fun greet(name) {
print "Hello, " + name + "!";
}
greet("Alice");
class Person {
init(name, age) {
this.name = name;
this.age = age;
}
sayHello() {
print "Hello, my name is " + this.name;
}
}
var alice = Person("Alice", 25);
alice.sayHello();
- Dynamically typed
- Object-oriented (single inheritance)
- Functions as first-class citizens
- Lexical scoping
-
Clone the repository:
git clone https://github.com/your-username/typhoon.git cd typhoon -
Build and run:
cargo run
Run a Typhoon script with:
typhoon script.typhoonOr enter the REPL mode:
typhoon
>Feel free to open issues and pull requests!
This project is licensed under the MIT License.