HN
Today

Rust but Lisp

This project, "Rust but Lisp" (rlisp), is a transparent s-expression frontend that compiles directly to Rust, effectively offering Lisp syntax for Rust's robust semantics without introducing any new runtime or garbage collection. It's designed to bring the powerful metaprogramming capabilities of Lisp-style macros and structural editing to the Rust ecosystem. The Hacker News discussion centers on whether this is a valuable integration or merely a superficial syntactic change, with strong opinions on both sides regarding its utility.

27
Score
8
Comments
#2
Highest Rank
13h
on Front Page
First Seen
May 9, 11:00 PM
Last Seen
May 10, 11:00 AM
Rank Over Time
223561012151518212523

The Lowdown

rlisp, or "Rust but Lisp," is an innovative project that re-imagines Rust's powerful, low-level semantics through a Lisp-like s-expression syntax. Operating as a transparent frontend, it directly transpiles this Lisp-flavored code into standard Rust, maintaining a strict zero-runtime and zero-garbage-collection philosophy by relying entirely on rustc for core compilation tasks.

  • Transparent Syntax Mapping: rlisp meticulously translates a wide array of Rust constructs, including functions (fn), variable declarations (let), data structures (struct, enum), control flow (match, if), and object-oriented features (impl, trait), into their s-expression equivalents.
  • Semantic Fidelity: Crucially, rlisp introduces no new semantics. All type checking, borrow checking, and optimizations are handled by the Rust compiler, ensuring full compatibility and leveraging Rust's safety guarantees.
  • Lisp-style Macros: A primary motivation is to simplify macro development. rlisp macros are compile-time s-expression transformers that utilize Lisp's quasiquote, unquote, and unquote-splicing paradigms, aiming to be far more intuitive than Rust's proc_macro system.
  • Structural Editing Benefits: The inherent balanced and homogeneous nature of s-expressions offers significant advantages for editor tooling, enabling more straightforward structural code manipulation.
  • Inline Rust Escape Hatch: For anything not natively expressible in rlisp, developers can embed raw Rust code directly using (rust "...") statements.

While conceived partly as an exploratory

The Gossip

Syntax & Semantic Scrutiny

Some commenters questioned the project's fundamental purpose, arguing that it's merely a superficial syntactic layer over Rust rather than a 'proper' Lisp dialect. Critics suggested that existing Lisp implementations already offer powerful macro systems and that this project lacks novelty or is an 'LLM-generated' idea, expressing skepticism about its necessity or why it gained attention.

Rust's Lispian Lure

Conversely, many users defended rlisp's specific approach, highlighting its unique value proposition: bringing Lisp's renowned macro power and structural editing benefits directly to Rust's ecosystem. Proponents emphasized that the goal is *not* to replace Lisp, but to provide an alternative syntax for Rust that retains all of Rust's critical semantics—like ownership and borrowing—while simplifying metaprogramming and offering a different development experience for those who appreciate Lisp's syntax.

Documentation Disdains

A distinct point of contention revolved around a common phrasing in project descriptions, specifically the 'no X, no Y, just Z' structure. One commenter expressed strong disapproval, labeling it an 'LLMism' and perceiving it as unhelpful or 'slop' in technical documentation.

Rust but Lisp - HN Today