Haskell doesn't need macros, eh?

Mar 06, 2008 11:25

A comparison of the Haskell argmunger with its Arc equivalent (or even its Perl equivalent) should make something clear. It's been claimed that Haskell doesn't need macros, because most of the things that Lispers need macros for can be done in Haskell using lazy evaluation and so on. But the argmunger example makes it clear that there are things ( Read more... )

lisp, template haskell, programming, rants, haskell, computers, beware the geek, argmungers

Leave a comment

Comments 4

anonymous March 6 2008, 15:17:41 UTC
Argmunger... sounds like the name of the next Minister for Magic.

Reply


macros + strong typing = ? ryani March 7 2008, 20:36:21 UTC
I agree that a "real language" needs lispy macros. I'm not really happy with TH's approach, though, especially that you need to explicitly tell the compiler to run a macro with a splice; it should look like a regular function call ( ... )

Reply

Re: macros + strong typing = ? pozorvlak March 7 2008, 22:00:37 UTC
I can't make my mind up about the need for explicit splices. On the one hand, it makes macros considerably less useful for implementing DSLs - or rather, all your DSLs need to have lots of $ signs dotted about the place :-) On the other, macros and functions have different semantics, so maybe it's not such a bad thing to have them visually distinct. Hmmm, is that still true in a lazy language? Not sure. More experience needed.

I definitely need to learn about dependent types some time. I wasn't aware of the proof drawback!

I guess TH puts a limited form of dependent types into Haskell; as long as the types can be fully instantiated into non-dependent types at compile time.
I think you've hit the nail on the head here! How much of a limitation that is remains to be seen...

Reply


ryani March 8 2008, 04:08:47 UTC
The proof drawback is pretty simple to explain ( ... )

Reply


Leave a comment

Up