Language guide · 2 of 12
Bindings & Mutability
Evie uses two distinct operators for declaration vs reassignment:
:=always creates a new binding.=always reassigns an existing mutable binding.
Safe by Default (Immutable Bindings)
When you declare a binding with := alone, it is immutable (like const in JavaScript or let in Rust):
name := "John" // immutable binding
items := [1, 2, 3] // immutable binding
name = "Jane" // Compile Error: Assignment to constant bindingOpen in playgroundExplicit Mutability (var)
To make a binding reassignable, prefix it with var:
var counter := 0 // mutable binding
counter = counter + 1 // OK
counter += 5 // OK (compound assignment)Open in playgroundWhy This Design?
Most developers default to the shortest keyword (e.g. var in JS). In Evie, the path of least resistance (x := 10) gives you safety and immutability by default. When mutability is needed, var x := 10 is an intentional, visible choice.