Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This isn't intended for people interested in other languages; if you like CoffeeScript, certainly use it. I really like ClojureScript myself. But there's a lot of reasons you already need a build step for JS anyway (especially for client-side), and this gives you a lot of power without having to completely switch languages.

It's worth noting that sweet.js is a robust macro system grounded in academic research (the core of it from the Honu paper). That CoffeeScript system is a bit of a hack and its flaws would show it the whole community started using it (I don't have time to go into this right now, but things like hygiene, etc are really difficult).



Hi, I made macros.coffee, and I'd like to say that this guy is right. It's non-hygenic (on purpose) and it's a hack.

And purely a labor of love! Slides: http://mrluc.github.io/hammy/12-7-rum-macros/deck.html#1 Code: http://mrluc.github.io/macros.coffee/docs/macros.html

I wanted to see how easily I could add (non-hygenic) macros to CoffeeScript, and if I could do it as an npm-installable module instead of a fork of the language.

It was also an experiment in making macros very clear to myself. Non-hygenic (CL-style) macros are very simple conceptually.

But the basic hack that made it possible to get true CL-style macros also makes the whole thing incredibly dependent on the structure of the CoffeeScript AST. Which makes it fragile.

I'm excited by BlackCoffee, actually. This is the first I've heard of it. Thanks a lot for giving me a nod in the github PR, and of course let's mention Oran Looney as well, who wrote the best deepcopy ever for Javascript (I wrapped this up as owl-deepcopy and made an npm module for it).




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: