Ownership you can read.
Kon compiles to native code with no garbage collector. Every call shows whether data is read, changed or handed over, and there are no lifetimes to learn.
The goal is a language as safe as Rust, as fast as C and easier to read than both. It is a goal, not yet a result: Kon is still being built.
struct Player {
name: String
health: i32
}
// view reads, edit changes, take hands over.
func describe(player: view Player) {
print(player.name)
print(player.health)
}
func heal(player: edit Player, amount: i32) {
player.health += amount
}
func main(): i32 {
var hero = Player { name: String("An"), health: 80 }
heal(edit hero, 20)
describe(hero)
return 0
}Safe first
Code without unsafe is meant to be unable to corrupt memory. Moves and borrows are checked when you compile, and errors point at the exact line.
Readable next
The words view, edit and take appear in the code that uses them. There are no lifetime annotations to learn, and one syntax with no statement semicolons.
Then fast and light
List access is compiled inline with its bounds check kept. Small programs stay small, with no heavy runtime behind them.
Five programs on one machine do not rank languages in general. How these were measured.