Hacker News new | ask | show | jobs
by alphonse23 3623 days 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.... 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.
1 comments

> 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++.

The 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).

Right, 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/01835...