
Haskell is itself quite good at removing boilerplate code. In fact, we Haskellers sometimes take pride in writing clean and boilerplate-free code. Forcing us to use metaprogramming undermines our pride. That's why Template Haskell is much more disliked than other forms of metaprogramming — CPP, C++ templates, Lisp macros, Tcl, Forth, etc. It essentially boils down to this: Template Haskell is hated because Haskell itself is so damn good. Of course, if you have a shitty language to start with, then metaprogramming can only be seen as great help.
Personally, I'm opposed to any form of metaprogramming. I prefer simplicity (says the guy who once asked SPJ if we're going to have polymorphic kinds), so I like having abstractions that semantically lie in the problem domain. Metaprogramming constructs, by definition, have their semantics defined in terms of the code they generate. I don't want to think about code. Ideally, I'd prefer not to see any code, but that's not on the plate right now. That's why I don't like metaprogramming, except for C++ templates, they have some sort of beautiful ugliness.
On 08 Feb 2014, at 05:13, Luke Clifton
I was rather frustrated with the use of Template Haskell as the main entry point for the big framework projects (Yesod, Snap, etc.)
Perhaps slightly off topic, but can someone outline why Template Haskell has so much negativity?
I've used Yesod a bit, and from my limited experience, the TH does a good job at removing a lot of boilerplate code, while still keeping things readable and type safe.
The main negatives I see are somewhat complicated error messages if you make a mistake, but the issue is usually pretty easy to spot because the TH is pretty simple.
Is portability an issue? How do the other Haskell compilers go with it?
Not to detract from your work, I think it's great to have options! I'm just curious. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe