Re:Stop Writing JavaScript Compilers, Make Macros Instead
by 6cxs2hd6 on Wednesday January 08, 2014 @03:20PM
(#7026282)
Racket shows how, with strong module support, a whole "tower of languages a.k.a. macros" can work reliably. Else not so much.
Re:Stop Writing JavaScript Compilers, Make Macros Instead
by klibertp on Wednesday January 08, 2014 @05:02PM
(#7027063)
Also, macros in racket are lexically scoped. Any modern macro system should follow their design, IMHO.
Re:Stop Writing JavaScript Compilers, Make Macros Instead
by dherman on Wednesday January 08, 2014 @11:23PM
(#7028750)
Agreed, and happily sweet.js is very consciously modeled after Racket.
import { foo, bar } from "macros";
The scoping of macros will all stay in tact; any other macros from "macros.js" will be available, but the code that `foo` or `bar` expands to will be able to access them (this is really nice for helper macros and other things).
So yes, modules are going to be a big part of distributing and composing macros.