Lisette a little language inspired by Rust that compiles to Go
Lisette introduces a new language that combines Rust's powerful syntax and type system with the ergonomic runtime and ecosystem of Go. It aims to address Go's perceived type system limitations while leveraging its runtime benefits, sparking enthusiasm among those seeking Rust-like safety without its low-level memory management. The project highlights the ongoing quest for languages that balance correctness, performance, and developer ergonomics, particularly by leveraging existing battle-tested runtimes.
The Lowdown
Lisette is a novel programming language designed to blend the robust type system and expressive syntax of Rust with the efficient runtime and vast ecosystem of Go. Positioned as "a little language," it compiles directly to Go, allowing developers to benefit from Go's concurrency model and tooling while writing code that feels familiar to Rustaceans.
Key features of Lisette include:
- Rust-inspired Language Constructs: Supports algebraic data types (enums), exhaustive pattern matching, expression-oriented programming, and immutable-by-default bindings, mirroring Rust's approach to safety and clarity.
- Elimination of
nil: Replacesnilwith explicitOption<T>andResult<T, E>types for robust error handling and absence representation, ensuring type safety. - Strong Type System: Employs a Hindley-Milner type system, providing powerful type inference and compile-time checks, including strict enforcement for exhaustive pattern matches.
- Go Interoperability: Designed for seamless interaction with existing Go libraries and packages, allowing Lisette code to leverage Go's extensive standard library and third-party modules.
- Developer Experience: Offers detailed, helpful compiler error messages with "help" hints, and includes features like deferral, panic recovery, serialization attributes, and LSP support for popular editors.
- Concurrency Model: Integrates with Go's goroutines and channels for concurrent programming, offering familiar primitives like
taskblocks andselectstatements.
Lisette represents an intriguing effort to marry the best aspects of two popular modern languages, promising the correctness and expressiveness associated with Rust's design principles alongside the runtime characteristics and ease of deployment of Go. It seeks to provide a language that is both safe and ergonomic, avoiding common pitfalls like nil panics and unhandled errors.
The Gossip
Syntactic Superiority & Go's Gaps
Many commenters quickly hailed Lisette's syntax as a significant improvement over Go, particularly praising its inclusion of algebraic data types, exhaustive pattern matching, and the explicit handling of `Option`/`Result` types. The discussion highlights a long-standing desire within the Go community for these features, viewing Lisette as a viable path to achieving Rust-like type safety and expressiveness on the Go runtime.
Runtime vs. Correctness Conundrum
A central debate revolved around the decision to compile to Go and leverage its runtime, rather than building a zero-runtime language like traditional Rust. Some view the reliance on Go's GC as a step backward from Rust's performance promises, while others, desiring "Rust with a GC," see it as an ideal compromise, offering correctness and ergonomics without the complexities of manual memory management. This theme explores the trade-offs between runtime characteristics and developer experience.
Design Details & Developer Delights
Commenters delved into the specific design choices of Lisette, scrutinizing subtle syntax differences from Rust and questioning their implications for learnability and transferability of knowledge. However, there was widespread appreciation for the detailed and helpful compiler error messages, which significantly enhance the developer experience. Practical considerations like LSP mapping for debugging and seamless Go interop were also key points of inquiry.
Polyglot Prospects & Transpilation Trends
The discussion naturally broadened to include other languages that compile to Go or Rust, illustrating a growing trend of developing higher-level or more expressive languages that leverage existing, robust runtimes. This reflects a broader interest in creating specialized languages that target specific ecosystems, aiming to combine the strengths of different language paradigms.