News for hackers. Stuff that matters.
Re:Hell Is Other REPLs by tialaramex on Sunday August 29, 2021 @05:42PM (#28350723)
> 1. You don't need to write a parser.

One of the things people really like about Rust is its fantastic error messages. They're very helpful.

But, having decided you "don't need to write a parser" you're in a tough place for your DSL since there are problems where Lisp's parser will just tell your DSL programmers something went wrong here and leave them clueless as to what exactly is wrong in their program. Rust wouldn't have done that, but of course its compiler owns the parser too so it gets to handle all the corner cases correctly.

Re:Hell Is Other REPLs by binarybanana on Monday August 30, 2021 @09:46AM (#28355600)
You can add descriptive error messages when an error happens (like multiple mutable borrows) during macro expansion. Macros are just regular list code, so all runtime features like printing functions are available.

You could even write a FPS using OpenGL where shooting functions, or pieces of suctions removes them from the current compile job (or even deletes them from the source code entirely). In a macro.

Re:Hell Is Other REPLs by tialaramex on Monday August 30, 2021 @04:04PM (#28360256)
I mean, that's nice, Rust's proc macros get to emit descriptive error messages† too, but for that to happen the macro expansion occurred and that means we didn't have a parse error. So you're dodging the problem.

† Or of course, to deliberately not emit descriptive error messages, e.g. whichever-compiles!