Immutable unless you ask
x := 10 can never change. var x := 10 can. Mistakes surface at compile time, not three calls later.
A scripting language for Go programs
Evie is a dynamically typed language written in pure Go. Bindings are immutable unless you say otherwise, tasks run as cooperative fibers you can await, and a Go program can embed it in a few lines.
Install the CLIgo install github.com/hxkhan/evie/evie@latest
package main imports("io")
class Account(owner) {
var balance := 0
fn deposit(amount) {
this.balance += amount
}
fn withdraw(amount) {
if amount > this.balance {
throw error("not enough money")
}
this.balance -= amount
}
}
fn main() {
account := Account("Ada")
account.deposit(100)
account.withdraw(30)
io.println(`{account.owner} has {account.balance} left`)
}
x := 10 can never change. var x := 10 can. Mistakes surface at compile time, not three calls later.
go starts a fiber and hands back a task. await, await.all, await.race, timeouts and cancellation are built in. One fiber runs at a time, so shared state needs no locks.
Fields are known when the program compiles, so this.x is a slot, not a lookup. Single inheritance, super, bound methods and is checks.
Every error shows the source with the span underlined, the call trace, and a suggestion when a name is almost right.
Typed wrappers turn Go functions into natives. Host types, sandboxed files, context deadlines and Interrupt keep scripts on a leash.
No cgo, no JIT, a closure compiler over a 16-byte value. It is the fastest language you can embed in Go, 3 to 10 times ahead of the others, and a little faster than Lua 5.4 overall.
Geometric mean of eight workloads, from recursion and closures to strings and matrix math, process start included. Lower is better.