Skip to content

Grayscale

Grayscale

Simple to write. Safe to run.

#flags
const Permissions enum {
READ
WRITE
EXECUTE
}
const User struct {
name string
perms Permissions
do can(self User, flag Permissions) -> bool {
return (self.perms bit_and flag) != 0
}
do rename(&self User, name string) {
self.name = name
}
}
do main() {
mut admin = User {
name: "admin",
perms: Permissions.READ bit_or Permissions.WRITE
}
admin.rename("root")
if admin.can(Permissions.WRITE) {
println("${admin.name} has write access")
}
}

Simplicity

A minimal set of orthogonal features. Clean syntax with do, mut, const, and natural control flow keywords.

Clarity

Explicit syntax that reads naturally. String interpolation, multiple return values, and pattern matching with when/is.

Safety

Static type checking and runtime bounds checking. Overflow detection and first-class error handling built in.