Created: 31-03-2026. Updated: 06-04-2026.
Most of the rules correspond to the tests.
Contents
interface Arith
add: (Int, Int) -> Int
sub: (Int, Int) -> Int
end
For consistency.
Interface is nominally typed.
Similar to Typescript.
class User
data
id: Int
name: Str
end
new(id: Int, name: Str) -> Self
return ^Self {id = id, name = name}
end
end
For consistency.
This is similar to Ruby.
This is the fields. For easy parsing. Might change later.
This is obvious.
Empty class is mostly for utility. In ImoLua, to make utility class
you can use Lone object (later).
ImoLua can parse it without ambiguity.
new constructorJavascript's constructor is too long to type.
There is no implicit constructor.
Might change later.
Self instead of the class nameThere is only one way to do thing.
new constructorFor above example:
let a = User(1, "Alex")
new constructornew is not callable.
self argumentFollows Lua.
Class is immutable. You cannot assign instance method to variable
because self will not bound.
:To differentatiate it with field/map access.
a:method(args)
.a.method(args) -- Wrong.
.let id = a.id
Not like Ruby and JS.
End.