D. Gregor | 17 May 20:50
Picon

Haskell-Cafe Info Page

Hello,

Common Lisp is a multiparadigm, general purpose programming language that supports imperative, functional, and object-oriented programming paradigms.  Haskell is purely functional.  Is this a reason why there is not macro feature in Haskell?  I feel the object-oriented paradigm of CL and Scheme is the reason for the macro feature in these two languages.  If it's not, then what does the macro feature provide, and why isn't it in Haskell?

Douglas
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Picon
Favicon

Re: Haskell-Cafe Info Page


On 2008 May 17, at 14:52, D. Gregor wrote:

Common Lisp is a multiparadigm, general purpose programming language that supports imperative, functional, and object-oriented programming paradigms.  Haskell is purely functional.  Is this a reason why there is not macro feature in Haskell?  I feel the object-oriented paradigm of CL and Scheme is the reason for the macro feature in these two languages.  If it's not, then what does the macro feature provide, and why isn't it in Haskell?

Macros in Lisp have less to do with functional vs. non-functional than with programs and data having precisely the same form (s-expressions).

There is a macro facility of the kind you're thinking of in Haskell (Template Haskell), but you have to work with abstract syntax tables which look nothing like the original code.

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery <at> kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery <at> ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Don Stewart | 17 May 21:16
Gravatar

Re: Haskell-Cafe Info Page

allbery:
>    On 2008 May 17, at 14:52, D. Gregor wrote:
> 
>      Common Lisp is a multiparadigm, general purpose programming language
>      that supports imperative, functional, and object-oriented programming
>      paradigms.  Haskell is purely functional.  Is this a reason why there is
>      not macro feature in Haskell?  I feel the object-oriented paradigm of CL
>      and Scheme is the reason for the macro feature in these two languages.
>       If it's not, then what does the macro feature provide, and why isn't it
>      in Haskell?
> 
>    Macros in Lisp have less to do with functional vs. non-functional than
>    with programs and data having precisely the same form (s-expressions).
>    There is a macro facility of the kind you're thinking of in Haskell
>    (Template Haskell), but you have to work with abstract syntax tables which
>    look nothing like the original code.

Also, laziness is used for many of the coding jobs you might use macros
for. So there's less need for macros.

-- Don
Denis Bueno | 17 May 21:19
Picon

Re: Haskell-Cafe Info Page

On Sat, May 17, 2008 at 3:16 PM, Don Stewart <dons <at> galois.com> wrote:
> allbery:
>>    On 2008 May 17, at 14:52, D. Gregor wrote:
>>
>>      Common Lisp is a multiparadigm, general purpose programming language
>>      that supports imperative, functional, and object-oriented programming
>>      paradigms.  Haskell is purely functional.  Is this a reason why there is
>>      not macro feature in Haskell?  I feel the object-oriented paradigm of CL
>>      and Scheme is the reason for the macro feature in these two languages.
>>       If it's not, then what does the macro feature provide, and why isn't it
>>      in Haskell?
>>
>>    Macros in Lisp have less to do with functional vs. non-functional than
>>    with programs and data having precisely the same form (s-expressions).
>>    There is a macro facility of the kind you're thinking of in Haskell
>>    (Template Haskell), but you have to work with abstract syntax tables which
>>    look nothing like the original code.
>
> Also, laziness is used for many of the coding jobs you might use macros
> for. So there's less need for macros.

Precisely so.  For example, macros are often used to implement control
operators (e.g. specific kinds of complicated iteration), which is
easily done in haskell with normal functions, due to laziness.

--

-- 
 Denis

Gmane