Re:Shen: A Sufficiently Advanced Lisp [video] (2014)
by necubi on Tuesday March 31, 2015 @05:31PM
(#9300043)
Scala has macros [0], and as you reasoned the type checker has to run after the macro expansion. That's not a huge downside; to the user it still appears to be a single pipeline (parsing -> macro expansion -> type checking -> compilation).
Haskell also has very powerful metaprogramming facilities, like template haskell [1].
[0] http://scalamacros.org/ [1] https://wiki.haskell.org/Template_Haskell
Re:Shen: A Sufficiently Advanced Lisp [video] (2014)
by doublec on Tuesday March 31, 2015 @05:14PM
(#9299944)
ATS had macros: http://ats-lang.sourceforge.net/htdocs-old/TUTORIAL/contents...
I'm not sure if these made it into ATS2 though.
Re:Shen: A Sufficiently Advanced Lisp [video] (2014)
by deech on Tuesday March 31, 2015 @07:04PM
(#9300485)
The second half of the talk (http://www.youtube.com/watch?v=lMcRBdSdO_U&t=17m30s) is about turning a JSON object into a type using macros and meta-programming.
Re:Shen: A Sufficiently Advanced Lisp [video] (2014)
by gmfawcett on Tuesday March 31, 2015 @07:14PM
(#9300528)
MetaOcaml's type-safe staged metaprogramming is not strictly a macro system, but it is morally equivalent: http://okmij.org/ftp/ML/MetaOCaml.html
Re:Shen: A Sufficiently Advanced Lisp [video] (2014)
by sordina on Tuesday March 31, 2015 @06:22PM
(#9300310)
> it seems impossible to have both macros and a type system on par with Haskell
You should check out the work being done on typed template Haskell then.
Re:Shen: A Sufficiently Advanced Lisp [video] (2014)
by andrewchambers on Tuesday March 31, 2015 @06:26PM
(#9300326)
You can have a language which has to be parsed top down, then you can have both complete type info, and arbitrary macros.
I am open to being proven wrong, though...