Rust but Lisp

· devtools · Source ↗

TLDR

  • rlisp is a transparent s-expression frontend that transpiles directly to Rust source, relying on rustc for type checking, borrow checking, and optimization.

Key Takeaways

  • No runtime or GC added: rlisp is purely a syntax transform, outputting .rs files compiled by rustc unchanged.
  • Full Rust semantics preserved: ownership, borrowing, lifetimes, generics, traits, and pattern matching all expressed as s-expressions.
  • Macros are plain s-expression functions using quasiquote/unquote/unquote-splicing, requiring no proc_macro, syn, or quote crates.
  • Escape hatch via (rust "...") inline for anything rlisp cannot express natively.
  • Structural editing benefit: s-expressions enable slurp/barf/transpose operations with balanced parens by construction.

Hacker News Comment Review

  • Core tension flagged immediately: this is Rust written in s-expression syntax, not a Lisp dialect with Lisp semantics compiled to Rust – the distinction matters for what you actually gain.
  • The practical justification offered is hygienic compile-time macros without the proc_macro ceremony, which is the one concrete semantic win over standard Rust.

Original | Discuss on HN