Defeating Racket’s separate compilation guarantee

(lexi-lambda.github.io)

109 points | by galfarragem 1823 days ago

4 comments

  • tlavoie 1822 days ago
    Very cool write-up, thanks!

    I've long appreciated the wizardry that Common Lisp's macros enable, and knew (distantly) that Racket does macros, but was completely unfamiliar with this separate compilation guarantee. If I understand it at all, it's basically a way of getting the benefit of macros without permitting some of the crazier stunts you might be tempted to pull. Neat.

    In any case, figuring out a way around that guarantee, and taking us along for the ride, is greatly appreciated.

  • schwurb 1823 days ago
    Not reading this now, but will totally reading it when I want to learn about macros. All the stuff that Alexis is doing is always mind-expanding and well-explained!
    • neilv 1822 days ago
      Depending on how you learn, you might find it easier to start by learning the normal patterns and tools for how one does macros (aka "syntax extension") in Racket, and later coming back to this article.

      The advanced adversarial stuff Alexis is doing can help some people understand the underlying model better upfront, but other people thinking they have to know it upfront will be needlessly discouraged.

      There's also a risk of learning the fancy things too soon: people seem to fixate on the fancy things, sometimes to the detriment of the basics. My favorite example is when newbies to a language will hear of `eval`, which is almost insanely powerful, and then their solutions tend to include `eval` when there are almost always vastly better solutions.

      • schwurb 1822 days ago
        I appreciate the advice in general; but don't worry - Learning stuff in odd order was never a problem for me and also while I love to learn systems and languages starting from the edge cases and broken corners,the code that I write reflects none of my love for curiosities ;)
  • myWindoonn 1823 days ago
    Ambient authority strikes again.