原文
Algebraic data types · Pattern matching · No nil ·
Hindley-Milner type system · Immutable by default
Interoperability with Go's ecosystem
import "go:fmt" import "go:io" import "go:os" fn load_config(path: string) -> Result<Cfg, error> { let file = os.Open(path)? defer file.Close() let data = io.ReadAll(file)? parse_yaml(data) } fn main() { match load_config("app.yaml") { Ok(config) => start(config), Err(e) => fmt.Println("error:", e), } }