Lisp implemented in Rust macros

by quasigloamon 9/13/2024, 9:31 PMwith 79 comments

by duetosymmetryon 9/13/2024, 10:17 PM

Greenspun's tenth rule strikes again! https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule

by celeritasceleryon 9/14/2024, 1:28 AM

I tried doing something similar to this once. I ran into an issue where I couldn’t define symbols with a dash in them (DEFINE MY-FN…). This is because rust will split the tokens on a dash. It was a small thing, but it meant I couldn’t just copy and paste snippets from a real lisp, I had to transform everything to underscore. Is it the same in your implementation?

by gleennon 9/13/2024, 9:56 PM

I wish there was a well-supported Lisp in Rust, not just the macros. I wonder how much memory safety you would retain or lose being based in Rust. Is it even possible to leverage the borrow checker any any sane way?

by p4bl0on 9/13/2024, 10:18 PM

That was fun. Thanks for sharing!

by krickon 9/14/2024, 4:43 AM

Everyone is supposed to be cheering for how "fun" it is, but every time I see anything like that I cannot help but think, that I hate the fact it can be implemented in Rust. It never truly was a simple language, but I think it started as something way more manageable than what it has become.

by brundolfon 9/14/2024, 3:38 AM

Wow and it uses macro_rules

by meindnochon 9/14/2024, 9:37 AM

But C++ is not a sane language because templates are Turing-complete, right?

by djha-skinon 9/14/2024, 4:06 PM

Obligatory reference to Carp[1], the lisp that uses borrow checking; the "rust" of lisps.

1: https://github.com/carp-lang/Carp

by elifon 9/14/2024, 1:10 AM

Hmmmmmmm.... Rustemacs?

by Validarkon 9/14/2024, 9:10 AM

This is super awesome!