NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
Gödel, Escher, Elisp: The Beauty of Macros (chiply.dev)
meken 2 hours ago [-]
> To anticipate a common question: why couldn't my-unless be a function? Function arguments are evaluated eagerly, before the function ever sees them.

Interesting, so if you’re using a lazy language then you don’t need a macro here and could write my-unless as a function.

phyzix5761 4 minutes ago [-]
You could do that as well with lisp by passing around lambdas to functions but that adds unnecessary syntax.
brabel 1 hours ago [-]
Yes, the D language has that as a feature in function arguments!

https://dlang.org/articles/lazy-evaluation.html

It makes it hard to know when things run. In Lisp you also have that problem everywhere, of course.

As the post shows this allows you to do stuff that looks like extending the syntax of the language.

I can’t decide if I love it or hate it!

kimi 2 hours ago [-]
Remember the golden rule of Lisp macros: don't write a macro.
hencq 6 minutes ago [-]
Meh, that seems to be a bit of a clojure thing. In the Racket world, with hygienic macros and phase separation, they'll routinely write macros returning macros, etc.
thisisauserid 1 hours ago [-]
I always thought it odd that Penrose gets dropped from the Escher conversations.
KeenanKeenan 2 hours ago [-]
If macros can implement arbitrary language features then how come elisp has never built a type system?
BeetleB 2 hours ago [-]
I would expect you can.

lexilambda created Typed Racket on top of Racket. https://github.com/racket/typed-racket

wk_end 2 hours ago [-]
KeenanKeenan 2 hours ago [-]
Typed racket too, might I add. I just imagine static typing around stable core APIs would help users understand how eglot and vertico compare to prior art. The way I learned how the completion stack works was to ask claude to show me what the elisp entrypoints would look like if implemented in typescript. It's not because I'm unfamiliar with lisp, I'm not, it's just easier to reason with the world in terms of data structures and their contracts.
2 hours ago [-]
1 hours ago [-]
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 17:40:26 GMT+0000 (Coordinated Universal Time) with Vercel.