4 ms·
I mentioned it in the comments of Edward Yang's article but I'll mention it here again, Template Haskell is based on C++ templates, here's the original paper ht
by alphonse23 10y ago
I mentioned it in the comments of Edward Yang's article but I'll mention it here again, Template Haskell is based on C++ templates, here's the original paper http://research.microsoft.com/en-us/um/people/simonpj/papers/meta-haskell/meta-haskell.pdf http://research.microsoft.com/en-us/um/people/simonpj/papers....
Haskell was written to mimic C++ more than lisp, at least when it comes to meta programming. And if you read the paper having the compiler check the template code before the expansion is there by design decision, that's why it's compile time only.
- naasking 10y ago> Haskell was written to mimic C++ more than lisp, at least when it comes to meta programming. Depends what you mean by "metaprogramming". Most people would consider type class "abuse" metaprogramming, but it's definitely not something inspired by C++.
- alphonse23 10y agoThe wikipedia definition is good: "Metaprogramming is the writing of computer programs with the ability to treat programs as their data. It means that a program could be designed to read, generate, analyse or transform other programs, and even modify itself while running." In my own words, code that can read and write code (whether that's at compile time or run time).
- naasking 10y agoRight, so then Haskell type classes qualify, and my original point stands. Certainly the type class language is limited, but common extensions make it Turing complete [1]. [1] https://mail.haskell.org/pipermail/haskell/2006-August/018355.html https://mail.haskell.org/pipermail/haskell/2006-August/01835...