News for hackers. Stuff that matters.
Re:Stop Writing JavaScript Compilers, Make Macros Instead by jlongster on Wednesday January 08, 2014 @02:56PM (#7026089)
The next big thing sweet.js is working on is modules. You will be able to actually pull in macros just like you would ES6 libs:

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.

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.
Re:Stop Writing JavaScript Compilers, Make Macros Instead by klibertp on Thursday January 09, 2014 @05:24AM (#7029674)
That's the best thing I read this morning and a reason why I'm going to give sweet.js a closer look :)
Re:Stop Writing JavaScript Compilers, Make Macros Instead by jlongster on Thursday January 09, 2014 @01:21AM (#7029101)
I just noticed a typo: I said "will be available" when I meant "will not be available". Any macros you don't import will not be in scope.