4 ms·
I'd also like to see macro capabilities in JS, although as others have said it's not trivial (but certainly not impossible) to add. For what its worth JSShaper
by olov 15y ago
I'd also like to see macro capabilities in JS, although as others have said it's not trivial (but certainly not impossible) to add.
For what its worth JSShaper [http://jsshaper.org http://jsshaper.org] may be of interest although it doesn't provide macros per se. It's an extensible framework for JavaScript syntax tree shaping (rewriting/transforming). For a macro-like example, I described how I created an assert plugin for it here: http://blog.lassus.se/2011/03/c-style-assertions-in-javascript-via.html http://blog.lassus.se/2011/03/c-style-assertions-in-javascri...
It gives you the power of macros and some, but with more power comes more complexity. Declarative style matching and rewriting remediates some of that, and it's the direction I'm taking JSShaper in.