Re:Stop Writing JavaScript Compilers, Make Macros Instead
by klibertp on Thursday January 09, 2014 @05:29AM
(#7029694)
There's also TypedClojure (https://github.com/clojure/core.typed) which is based on Typed Racket (is what I read in previous discussions about it here).
Re:Stop Writing JavaScript Compilers, Make Macros Instead
by nawitus on Wednesday January 08, 2014 @04:35PM
(#7026875)
Wow, that's impressive. I didn't realise macros can be that powerful in practise.
Re:Stop Writing JavaScript Compilers, Make Macros Instead
by innguest on Thursday January 09, 2014 @02:07AM
(#7029217)
Maybe this will help see the full scope of the power of macros: macros receive their arguments as an AST (i.e. a list) and are free to transform it as they please; they also have full access to the host language and are free to implement a type system checker that walks code and checks that all the types match. There are no restrictions here - the type checker would be regular scheme code that would be wrapped into a macro simply to make it run at compile time. So there's nothing less powerful about macros at all. It's just code that runs at a different stage (compile-time instead of run-time). After macros, in terms of power, you have reader macros, that receive their arguments as raw text and are free to turn it into any AST.
[1] http://docs.racket-lang.org/ts-guide/ [2] http://www.ccs.neu.edu/racket/pubs/pldi11-thacff.pdf