3 ms·
Racket likely has the most sophisticated (mostly) hygienic macro system out there. In particular, syntax parameters are a really neat feature which lets you imp
by slaymaker1907 7y ago
Racket likely has the most sophisticated (mostly) hygienic macro system out there. In particular, syntax parameters are a really neat feature which lets you implement things normally requiring breaking hygiene in a hygienic way. For example, implementing early return using return as a keyword can be done using a syntax parameter which allows for nesting, renaming the “return” if you want, and composing it with other macros which utilize their own “return” keyword.
- Quekid5 7y agoRacket truly has some great stuff wrt. macros -- I'm not sure if it was invented as a research vehicle for macros specifically[0], but they've even gone as far as implementing fairly advanced type systems as macros[1]. Besides the one I've linked, they have lots of interesting papers around the macro system: the handling of 'stages', the modularity, etc. Basically just google "Racket [something]" and go from there :) [0] Probably more just a general 'extensible languages' type thing? [1] http://www.ccs.neu.edu/home/stchang/pubs/ckg-popl2017.pdf http://www.ccs.neu.edu/home/stchang/pubs/ckg-popl2017.pdf
- quelltext 7y agoI only glanced over the paper but its novelty seems to lie in the turnstile language itself, i.e. the design of a metalanguage to define EDSLs that have a typesystem. Yes, it is built using macros and I assume cleverly uses whatever macro system features Racket provides so there is possibly something novel there as well. However, the fact that it can be done or has been done on its own is not quite so surprising to me. If you have the ability to inspect syntax you can obviously do something like that.
- fiddlerwoaroof 7y agoInterestingly enough, I think I heard it said that SweetJS was as the first implementation of Racket’s new “set of scopes” macroexpander