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

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.



Racket shows how, with strong module support, a whole "tower of languages a.k.a. macros" can work reliably. Else not so much.


Also, macros in racket are lexically scoped. Any modern macro system should follow their design, IMHO.


Agreed, and happily sweet.js is very consciously modeled after Racket.


That's the best thing I read this morning and a reason why I'm going to give sweet.js a closer look :)


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.




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

Search: