An interpreted language written in kotlin.
Syntax is like C, but without semicolons and no pointers.
void main() {
println("hello world")
}
Structs are supported. And you can declare const variables in struct parameters.
struct Human(str name, const int age)
Structs are passed by reference, but normal primitives are passed by value.
void main() {
let human = Human("John", 30)
doSomething(human)
println(human.name) //prints "new name"
}
void doSomething(Human human) {
human.name = "new name"
}
Typed unions with the "any" type.
any Either(Human, OtherHuman)
struct OtherHuman(str name)
void main() {
let either = Either(Human("John", 30))
if(either is Human) println(either.name) //prints "John"
either = Either(OtherHuman("Jane"))
if(either is OtherHuman) println(either.name) //prints "Jane"
}
Enums are supported.
enum Color {
Red,
Green,
Blue
}
void main() {
let color = Color.Red
if(color == Color.Red) println("Color is red")
}