4 ms·
Holy cow. It's built on macros, and macro-friendly! And I can use it with the node.js ecosystem! As a guy who built his own npm-installable macros.coffee, [0][
by mr_luc 13y ago
Holy cow. It's built on macros, and macro-friendly! And I can use it with the node.js ecosystem!
As a guy who built his own npm-installable macros.coffee, [0][1][2] I am torn.
I love macros enough that I felt I needed to have them in JS-family languages, which have few metaprogramming options outside of tricks on 'this', which is why, when I saw that CoffeeScript had clean syntax and a relatively clean AST, I made it my "learning node/npm" project to add them.
On the other hand, my project is simple because it depends on a fragile hack: running a deep-copy on a chunk of AST for 'quote'. It's a fragile hack that jashenkas could break with a single well-placed closure, and as I promised on my project page, "If you want to ... build a substantially more 'heavy-duty' implementation, I'll probably end up using yours." This isn't an implementation in CoffeeScript, but it's better -- it's actually built into the language (as macros work best as a core language component; once you have 'em, it's easiest to write your language with them).
I'll have to try out GorillaScript and see what it actually feels like to write code in the language, allowing for the fact that its syntax may not be as pretty as coffeescript yet. But I wouldn't be surprised to find myself using GorillaScript this time next year.
Macros++.
-----
0) github.com/mrluc/macros.coffee
1) http://mrluc.github.io/macros.coffee/docs/macros.html http://mrluc.github.io/macros.coffee/docs/macros.html
2) https://npmjs.org/package/macros.coffee https://npmjs.org/package/macros.coffee
- cameronkknight 13y agoInteresting work. Once I refactored GorillaScript to be pretty much fully macro-driven, it made everything super-nice to deal with. Every single syntax construct in GorillaScript is a macro, even `if` and all that stuff.