Rust but Lisp

(github.com)

67 points | by thatxliner 3 hours ago

12 comments

  • ecto 59 minutes ago
    Readers may enjoy my lisp, Loon, which takes heavy inspiration from Rust https://loonlang.com/guide/ownership
  • vermilingua 1 hour ago
    Claims to have all the syntax covered, but not a single example of specifying lifetimes or the turbofish, some of the trickiest rust syntax
    • kibwen 1 hour ago
      If you already have the ability to express the grammar productions in Rust that allow for optionally-specified types (e.g. variable declaration), then you have the ability to express lifetimes and the turbofish (which is just a curious way to call a generic function with a specific type parameter). The only weird thing would be that Lisp uses the apostrophe character for something very different than Rust, but you could just pick any other way to denote lifetimes.
      • vermilingua 1 hour ago
        Could!

        > Everything Rust has … expressed as s-expressions. No semantic gap.

    • andrepd 1 hour ago
      It's a vibecoded parser...
  • hawkice 2 hours ago
    I think some comments are missing the upside of it being precisely Rust, without any new semantics. If you want lisp that compiles to machine code, Common Lisp can get reasonably efficient. The purpose of bringing Rust into it is to surface Rust-specific semantics -- which many people quite like!
    • j16sdiz 1 hour ago
      Thanks LLM.
      • hawkice 37 minutes ago
        Incorrect, and mean-spirited. Come on.
  • jaggederest 1 hour ago
    Unfortunately, given the clear LLM basis of this project, s-expressions aren't a great choice. I've found coding agents struggle really hard with s-expression parentheses matching.

    Much better to give them something more M-expr styled, I think a grammar that is LL(1) is probably helpful in that regard.

    Basically the more you can piggyback on the training data depth for algol-style and pythonic languages the better.

    • gleenn 39 minutes ago
      That has definitely not been my experience as of late. I have produced multiple, largeish Clojure projects with AI that have been perfectly formatted and functional. Perhaps you were using an older or possibly smaller model? I am admittedly using Claude with higher end models and mid to high effort but it has been working great for months for me at this point.
    • dleslie 41 minutes ago
      Opus 4.6 handles elisp just fine. But I suppose YMMV.
    • 2ndorderthought 40 minutes ago
      Why are we even spending time on this. It's vibe coded slop. The creator probably never even ran it before it got to HN
  • GalaxyNova 2 hours ago
    It seems like this is more like writing Rust in an s-expression syntax instead of having a proper lisp dialect that compiles to Rust, which is cool I guess but not very interesting.

    It's quite weird-looking for someone who's done any amount of lisp programming.

    • noosphr 1 hour ago
      >Rust semantics with LISP syntax. A transparent s-expression frontend that compiles directly to Rust — no runtime, no GC

      The first paragraph says literally that.

    • monocasa 1 hour ago
      Yeah, it sort of reminds me of the microcode assembly of a few of the lisp machines, that, while in s-expressions were also clearly not lisp themselves. But could be an interesting target for some lisp macros.
    • shawn_w 1 hour ago
      A let that defines variables that have a lifetime beyond the scope of the expression? Yeah, that's really unusual. And it's not even the oddest looking thing from the first example block of code.
  • OhMeadhbh 53 minutes ago
    How do you change the syntax to eliminate reverse compatibility? I guess you could change the names of most key functions between releases. But to be compatible with rust you would need to make breaking changes every release.
  • amelius 1 hour ago
    This is probably what Rust's internal ASTs look like. But why would you want to input programs as ASTs?
    • physPop 1 hour ago
      so you can do the transformations (see the rlisp macro section)
      • amelius 1 hour ago
        Yes, but you could do the same by transforming Rust's ASTs. The only downside is that your input format is different from the format you are transforming. But the upside is that readability is much improved, which matters because code is typically read far more often than it is written.
  • stuaxo 2 hours ago
    "no runtime, no GC, just" I am BEGGING every project to not have this LLMism in their docs.

    It reads as No X no Y just slop to me every time.

    • andrepd 1 hour ago
      It's completely nonsensical too. Why would a parser for an alternative syntax introduce a GC?!
  • moron4hire 35 minutes ago
    I don't understand why this had to be LLM generated. S-expression syntax parsers are not hard to write. That's rather much the point of S-expressions.
    • Maxatar 6 minutes ago
      >S-expression syntax parsers are not hard to write.

      I'm not sure I quite understand the point of your comment.

      Are you implying that LLMs should be used for very hard to write code? I feel like the best use of LLMs is to automate the easy stuff so that I can focus on the hard to write stuff.

  • nxobject 48 minutes ago
    "Lust", or "Risp"?
  • FrankWilhoit 3 hours ago
    And for why?
    • macmac 3 hours ago
      To get proper macros.
      • fao_ 2 hours ago
        Scheme already has hygenic macros, I don't get why you'd vibecode a worse (less battle tested, llm-generated) replacement. I'm not sure why this hit the front-page, to be honest, because it doesn't seem noteworthy or interesting (Anyone and their mother can vibecode something like this in eight hours)
        • wk_end 2 hours ago
          Scheme doesn't have Rust semantics, though?
        • zem 2 hours ago
          this is not a replacement for scheme, it's simply an alternative syntax for rust
  • slopinthebag 38 minutes ago
    How is pure unbridled AI slop like this making the front page? Voting rings?

    I don't even feel bad saying this because clearly OP is just the front for Claude here.

    • gjvc 23 minutes ago
      you ain't seen nothin' yet.