Lisette,一种受Rust启发的迷你语言,编译为Go。
Lisette a little language inspired by Rust that compiles to Go

原始链接: https://lisette.run/

代数数据类型 · 模式匹配 · 无空值 · Hindley-Milner 类型系统 · 默认不可变 与 Go 生态系统互操作 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), } }

相关文章

原文

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),
  }
}
联系我们 contact @ memedata.com