Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-21 Thread Immanuel Litzroth
David F. Place [EMAIL PROTECTED] writes:

I was hoping that the examples I requested would be examples of
particular control constructs or extensions to the language's syntax
and semantics.  Though I admit that such things are possible in lisp,
I suspect that their utility is minimal.

Ever heard of the loop macro?
Immanuel Litzroth

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-21 Thread Tomasz Zielonka
On Wed, Sep 21, 2005 at 08:53:47AM +0100, Immanuel Litzroth wrote:
 David F. Place [EMAIL PROTECTED] writes:
 
 I was hoping that the examples I requested would be examples of
 particular control constructs or extensions to the language's syntax
 and semantics.  Though I admit that such things are possible in lisp,
 I suspect that their utility is minimal.
 
 Ever heard of the loop macro?
 Immanuel Litzroth

I would be nice if you could give some examples for use of LOOP macro
that you think would be cumbersome to translate to Haskell.

Best regards
Tomasz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-21 Thread Immanuel Litzroth
Tomasz Zielonka [EMAIL PROTECTED] writes:

 On Wed, Sep 21, 2005 at 08:53:47AM +0100, Immanuel Litzroth wrote:
 David F. Place [EMAIL PROTECTED] writes:
 
 I was hoping that the examples I requested would be examples of
 particular control constructs or extensions to the language's syntax
 and semantics.  Though I admit that such things are possible in lisp,
 I suspect that their utility is minimal.
 
 Ever heard of the loop macro?
 Immanuel Litzroth

 I would be nice if you could give some examples for use of LOOP macro
 that you think would be cumbersome to translate to Haskell.

That was not the original question and I think that would lead to
pointless discussion about the meaning of cumbersome.  
Loop is an example of a control construct that can be implemented by a macro.
One can can discuss it's utility, but it was deemed important enough to be
standardized (by lisp people). It was only one of the macros developed
at that time to do things sequencelike things (series, generators/gatherers were
others) .
Another example is UFFI, basically a bunch of macros to do platform
independent foreign function interfaces.
I a currently writing a macro to generate the functions and
datastructures to read an ipod database. This allows me to
declaratively say
(defheader (header-name inherits-from) 
   (field-name length optional reader)...).
I doubt this would be easy in Haskell (maybe with TH it could be done) 
since I build a list of (header-name . (field-names ...)) at compile
time which is then used to generate code that locally binds these 
to the result of reading them so that readers can refer to fields
already read e.g.
(let* ((field-name (reader stream)))
  ((field-name2 (reader field-name1 stream))

Immanuel

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-21 Thread Glynn Clements

David F. Place wrote:

 I don't deny that all of the things you mentioned are wonderful  
 indeed.  I just wonder if they really could only be done in lisp or  
 even most conveniently.

Obviously, if you can do it in Lisp, you can do it in any
Turing-complete language; in the worst case, you just write a Lisp
interpreter.

As for convenience: syntax matters. The equivalence of code and data
in Lisp lets you write your own syntactic sugar. You're still bound by
the lexical (token-level) grammar, although reader macros mean that
isn't much of a restriction.

-- 
Glynn Clements [EMAIL PROTECTED]
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-21 Thread David F. Place


On Sep 21, 2005, at 3:53 AM, Immanuel Litzroth wrote:


Ever heard of the loop macro?


Yes, the loop macro is a good example for the argument against lisp.   
Lisp has features to support iteration that date back to the time  
before it was understood that tail recursion is equivalent to  
iteration. In fact, even in the early '90s most common lisp compilers  
didn't implement tail-merging.  I doubt there is any program  
implemented using the loop macro that couldn't be more elegantly  
implemented recursively.  In fact, when writing in lisp or scheme, I  
always write recursively now that I can depend on compilers to tail- 
merge.




David F. Place
mailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-21 Thread Immanuel Litzroth
David F. Place [EMAIL PROTECTED] writes:

 On Sep 21, 2005, at 3:53 AM, Immanuel Litzroth wrote:

 Ever heard of the loop macro?

 Yes, the loop macro is a good example for the argument against lisp.
 Lisp has features to support iteration that date back to the time
 before it was understood that tail recursion is equivalent to
 iteration. 
 In fact, even in the early '90s most common lisp compilers
 didn't implement tail-merging.  I doubt there is any program
 implemented using the loop macro that couldn't be more elegantly
 implemented recursively.  
 In fact, when writing in lisp or scheme, I
 always write recursively now that I can depend on compilers to tail-
 merge.

I personally find loop usually the most concise way to express my
iteration requirements.  
Immanuel

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-21 Thread Tomasz Zielonka
On Wed, Sep 21, 2005 at 12:12:16PM +0100, Immanuel Litzroth wrote:
 Tomasz Zielonka [EMAIL PROTECTED] writes:
 
  On Wed, Sep 21, 2005 at 08:53:47AM +0100, Immanuel Litzroth wrote:
  David F. Place [EMAIL PROTECTED] writes:
  
  I was hoping that the examples I requested would be examples of
  particular control constructs or extensions to the language's syntax
  and semantics.  Though I admit that such things are possible in lisp,
  I suspect that their utility is minimal.
  
  Ever heard of the loop macro?
  Immanuel Litzroth
 
  I would be nice if you could give some examples for use of LOOP macro
  that you think would be cumbersome to translate to Haskell.
 
 That was not the original question and I think that would lead to
 pointless discussion about the meaning of cumbersome.  

You are right, sorry. I agree that the ability to create your own
control structures is a win. I only argue that when it's possible, it's
better to avoid using macros for this.

 Another example is UFFI, basically a bunch of macros to do platform
 independent foreign function interfaces.

Good example - laziness, HOFs and closures don't help much here.

 I a currently writing a macro to generate the functions and
 datastructures to read an ipod database. This allows me to
 declaratively say
 (defheader (header-name inherits-from) 
(field-name length optional reader)...).
 I doubt this would be easy in Haskell (maybe with TH it could be done) 

I am doing similar things with Haskell. The amount of TH code needed is
minimal, I prefer to put most of the machinery in the type system.

Best regards
Tomasz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-20 Thread David F. Place


On Sep 20, 2005, at 3:43 PM, Glynn Clements wrote:


That, in a nutshell, is Lisp's key strength. It uses the same
structure for code as for data, which makes it very easy to add new
language features.



I assume that you refer to `eval' and the fact it operates on conses  
and symbols.  Beyond the extremely contrived example of a  
metacircular interpreter, what are some examples of the benefits of  
this feature of lisp?   What are some examples of language features  
that are easy to add?



David F. Place
mailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-20 Thread Glynn Clements

David F. Place wrote:

  That, in a nutshell, is Lisp's key strength. It uses the same
  structure for code as for data, which makes it very easy to add new
  language features.
 
 
 I assume that you refer to `eval' and the fact it operates on conses  
 and symbols.  Beyond the extremely contrived example of a  
 metacircular interpreter, what are some examples of the benefits of  
 this feature of lisp?   What are some examples of language features  
 that are easy to add?

Well, to state the obvious, being able to extend or replace the
language's syntax and semantics. In particular, being able to do so
locally.

Probably the most useful consequence is the ability to create new
control constructs without being constrained by the existing syntax
and semantics (and without having to write your own monadic versions
of existing functions).

-- 
Glynn Clements [EMAIL PROTECTED]
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-20 Thread David F. Place
I was hoping that the examples I requested would be examples of  
particular control constructs or extensions to the language's syntax  
and semantics.  Though I admit that such things are possible in lisp,  
I suspect that their utility is minimal.


On Sep 20, 2005, at 4:55 PM, Glynn Clements wrote:


Well, to state the obvious, being able to extend or replace the
language's syntax and semantics. In particular, being able to do so
locally.

Probably the most useful consequence is the ability to create new
control constructs without being constrained by the existing syntax
and semantics (and without having to write your own monadic versions
of existing functions).





David F. Place
mailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-20 Thread Bill Wood
   . . .
 I was hoping that the examples I requested would be examples of  
 particular control constructs or extensions to the language's syntax  
 and semantics.  Though I admit that such things are possible in lisp,  
 I suspect that their utility is minimal.

As to utility, quite the contrary, I think.  Offhand I can think of the
screamer package for Common Lisp, which provides non-deterministic
mechanisms for use in backtracking applications.  For a while in the
80's there was practically a cottage industry implementing various
flavors of Prolog and other Logic Programming languages in Lisp; one
notable example was LogLisp.  I think many of the more advanced
constructs in CL were originally macro extensions to the earlier lisps;
e.g. structures, objects and classes, the LOOP macro, streams and
iterators, generalized setters and getters.

Actors, which was one of the ancestors of OOP, was first as a Lisp
extension.  In the AI hayday of the mid-80's most of the expert system
shells, providing forward and backward chaining mechanisms, frames and
semantic nets, and object-centered and data-driven programming, were
originally implemented as packages integrated into Lisp.

All of these made non-trivial extensions to Lisp, and all were of
arguably great utility.

 -- Bill Wood
[EMAIL PROTECTED]


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-20 Thread David F. Place


I don't deny that all of the things you mentioned are wonderful  
indeed.  I just wonder if they really could only be done in lisp or  
even most conveniently.  Many years ago I read a paper by Phil Wadler  
about logic programing using a functional language.  I think it was  
called something like How to replace failure with a list of  
successes.  (Great title!)  It blew my mind and made me doubt very  
much that the metaprogramming aspect of lisp had anything over clever  
functional programming.


Oh -- speaking of control structures -- once you start passing around  
continuations you can do anything.  Lisp has no advantage there.


On Sep 20, 2005, at 5:45 PM, Bill Wood wrote:


All of these made non-trivial extensions to Lisp, and all were of
arguably great utility.



David F. Place
mailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-20 Thread Greg Buchholz
Bill Wood wrote:
 
 As to utility, quite the contrary, I think.  Offhand I can think of the
 screamer package for Common Lisp, which provides non-deterministic
 mechanisms for use in backtracking applications.  For a while in the
 80's there was practically a cottage industry implementing various
 flavors of Prolog and other Logic Programming languages in Lisp; one
 notable example was LogLisp.

I think the goal was to present an application where Lisp macros
made for a more succinct program than the equivalent Haskell version. 

http://www.google.com/search?q=backtracking+monad


Greg Buchholz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-19 Thread Wolfgang Jeltsch
Am Freitag, 16. September 2005 16:46 schrieben Sie:
   . . .

  In Haskell, code is data too because code in the sense of imperative
  actions is described by IO values.  You cannot analyse them.  But you can
  use your do expressions etc. to construct action descriptions with a more
  general type like MonadIO m = m a.  Then you can instantiate m with a
  monad whose values store part of the action's structure so that this
  information can be used later.  Or you use a monad which doesn't keep
  structural information to use it for later processing but which does the
  processing upon construction.

 But, isn't this like saying that Java or C++ supports first-class
 function types because you can define a class with one method, the
 function of interest, and then create, pass, and return instances of the
 class?  Yeah, you can do that, but it's awfully clumsy.

But I could imagine that doing what I described in Haskell is not awfully 
clumsy.  In fact, I don't like the idea of dealing with code at run-time, 
except when it is absolutely necessary.

 Also, it seems to me that the heart of Haskell is functional, not
 imperative.  Can you create function definitions from data and evaluate
 them at runtime?

Of course!  Just define a function which takes an expression as an argument 
and returns the corresponding function, i.e., some kind of function parser.

 [...]

  -- Bill Wood
 [EMAIL PROTECTED]

Best wishes,
Wolfgang
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-19 Thread Wolfgang Jeltsch
Am Freitag, 16. September 2005 18:40 schrieben Sie:
 Wolfgang Jeltsch wrote:
 Bearing this in mind, and hoping you can see where I'm coming from,
 I think my question is: shouldn't you guys be using Lisp?
   
Lisp is impure, weakly typed and has way too many parentheses.  Why
would we use lisp? It seems to be lacking almost all the advantages
of Haskell, and have an ugly, inflexible syntax to boot.
  
   The ability to dynamically generate, manipulate and analyse code in a
   structured manner provides a flexibility which is unmatched by any
   other language I know of.
  
   A good example is Emacs; lisp is entirely the right language for that,
   IMHO.
 
  Could you explain this a bit more, please?  To the moment, I cannot
  imagine cases where you need LISP's way of code analysis and manipulation
  because Haskell's capabilities are not sufficient.
 
  In Haskell, code is data too because code in the sense of imperative
  actions is described by IO values.  You cannot analyse them.

 And thus they are not data.

They are some kind of opaque data.

  But you can use your do
  expressions etc. to construct action descriptions with a more general
  type like MonadIO m = m a.  Then you can instantiate m with a monad
  whose values store part of the action's structure so that this
  information can be used later.  Or you use a monad which doesn't keep
  structural information to use it for later processing but which does the
  processing upon construction.

 Yeah, but this is heading in the direction of Greenspun's Tenth Rule
 of Programming:

   Any sufficiently complicated C or Fortran program contains an
   ad hoc informally-specified bug-ridden slow implementation of
   half of Common Lisp.

 You could easily end up doing the same thing in Haskell. 

I'm not sure.  Haskell is much more powerful than C, for instance concerning 
the type system.  The point of the concept I described above is that the 
general MonadIO-based description of actions is very similar to what you 
would normally write when using IO directly.  I doubt that you can do 
something similar with C.

 [...]

 Or, to put it another way: if Haskell is so flexible, why do we need
 Template Haskell? I can't imagine a Template Lisp; it would just be
 Lisp.

Haskell alone is not so flexible but Haskell with Template Haskell is.  The 
difference is that the Haskell/Template Haskell combination separates 
compile-time evaluation/code generation clearly from runtime evaluation which 
is, in my opinion, a very good thing.

Best wishes,
Wolfgang
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-17 Thread Tomasz Zielonka
On Fri, Sep 16, 2005 at 06:56:10PM -0400, David F. Place wrote:
 
 On Sep 16, 2005, at 6:26 PM, Glynn Clements wrote:
 
 Haskell's safety and consistency can get in the way, while Lisp's
 freedom can be quite unsafe and inconsistent.
 
 and lazy evaluation eliminates 99% of the need for macros in lisp.

I wrote:
 supposedly unavailable in other languages. Surprisingly, most of these
 things were equally easy to do with higher-order functions and
 closures in Haskell.

... and laziness of course, and some other features too.

Did I say equally easy? It is often easier. Creating your own control
structures in Haskell is a pure pleasure.

Best regards
Tomasz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Mark Carter

This is not a troll, honest, so please bear with me ...

I'm a C/C++/VBA programmer (although the former 2 are several years old 
for me), with a sprinkling of Python. Needless to say, I was looking to 
see if there were any better ways of doing things. I've given things 
like Ruby and Scheme a bit of peck, and failed to get particularly 
enthusiastic about them. Two very interesting choices, though, appear to 
be Lisp and Haskell. It struck me that Lisp was, perhaps, the Ultimate 
Programming Language, the One True Language to rule them all; except 
that I always kept  abandoning it for one reason or another (fiddly 
installation, lack of libraries, compatability problems,  cost, possible 
license issues, etc.). My current foray in Haskell seems encouraging. 
wxHaskell installed a breeze, and seems quite usable (even though I'm a 
raw n00b to the language, and admittedly haven't grokked the semantics, 
and all this  cid:part1.01000702.09000407@yahoo.co.uk IO a - IO () 
business). On the one hand, it  seems kinda academic, but on the other, 
it looks like it wants to be practical, too.


Bearing this in mind, and hoping you can see where I'm coming from, I 
think my question is: shouldn't you guys be using Lisp?



___ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Harri Haataja
On Fri, Sep 16, 2005 at 12:34:57PM +0100, Mark Carter wrote:
 This is not a troll, honest, so please bear with me ...
 
 It struck me that Lisp was, perhaps, the Ultimate Programming
 Language, the One True Language to rule them all; except that I always
 kept  abandoning it for one reason or another (fiddly installation,
 lack of libraries, compatability problems,  cost, possible license
 issues, etc.). My current foray in Haskell seems encouraging.
 wxHaskell installed a breeze, and seems quite usable (even though I'm
 a raw n00b to the language, and admittedly haven't grokked the
 semantics, and all this  cid:part1.01000702.09000407@yahoo.co.uk IO
 a - IO () business). On the one hand, it  seems kinda academic, but
 on the other, it looks like it wants to be practical, too.

 Bearing this in mind, and hoping you can see where I'm coming from, I 
 think my question is: shouldn't you guys be using Lisp?

Given the words above, I wonder why the question is this way around :)

-- 
 Aqua Regis is HCl+H2SO4, and attacks gold.
While applying it to a luser, remember to sing
What a Friend We Have In Regis.
-- Patrick Wade
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Malcolm Wallace
Mark Carter [EMAIL PROTECTED] writes:

 Bearing this in mind, and hoping you can see where I'm coming from, I 
 think my question is: shouldn't you guys be using Lisp?

One of the early implementations of Haskell (the Yale Haskell Compiler,
now defunct) was written in Common Lisp.

Regards,
Malcolm
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread David Roundy
On Fri, Sep 16, 2005 at 12:34:57PM +0100, Mark Carter wrote:
 Bearing this in mind, and hoping you can see where I'm coming from, I 
 think my question is: shouldn't you guys be using Lisp?

Lisp is impure, weakly typed and has way too many parentheses.  Why would
we use lisp? It seems to be lacking almost all the advantages of Haskell,
and have an ugly, inflexible syntax to boot.

Obviously I don't like lisp, and I also greatly dislike parentheses,
sometimes irrationally so... as is reflected by my excessive use of the $
operator.  And I abhor dynamcially typed languages... although perl isn't
too bad (it goes all the way, and even perl has some static typing--scalars
versus arrays versus hashes).  The more bugs the compiler is able to find
before you actually run your code, the better, in my opinion.
-- 
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Mark Carter

Harri Haataja wrote:

On Fri, Sep 16, 2005 at 12:34:57PM +0100, Mark Carter wrote:

This is not a troll, honest, so please bear with me ...

It struck me that Lisp was, perhaps, the Ultimate Programming
Language, the One True Language to rule them all; except that I always
kept  abandoning it for one reason or another (fiddly installation,
lack of libraries, compatability problems,  cost, possible license
issues, etc.). My current foray in Haskell seems encouraging.
wxHaskell installed a breeze, and seems quite usable (even though I'm
a raw n00b to the language, and admittedly haven't grokked the
semantics, and all this  cid:part1.01000702.09000407@yahoo.co.uk IO
a - IO () business). On the one hand, it  seems kinda academic, but
on the other, it looks like it wants to be practical, too.


Bearing this in mind, and hoping you can see where I'm coming from, I
think my question is: shouldn't you guys be using Lisp?


Given the words above, I wonder why the question is this way around :)

The thing that struck me as being really cool about Lisp is the whole  
macro and the code is data idea. In the book Practical Common Lisp 
they show how data could be expressed as lists, which you could then 
easily serialise and deserialise to/from a file. How cool is that?! Plus 
you can use macros to extend the language.


Alas, pulling against this seems to be a number of minuses. The 
commercial Lisp implementations may be good, but what wannabe hacker is 
going to fork out the cash for those babies? The free ones that work on 
Windows are GPL, which means that although somebody might be tempted to 
use them for personal projects, he is not going to sell the idea to his 
boss that stuff should be developed in Lisp. Plus there are the 
fragmentation issues. I managed to get wxCL (wxWidgets for Common Lisp) 
to install and run on CLISP. I figured that ODBC connectivity should be 
next on the list, and found that I needed defsystem to make it run. So 
then I have to track down defsystem, get that installed, etc. etc.. It 
reminds me of one of those adventure games from my ZX81 days. In order 
to catch the bird you need the cage and the seed, but oh dear, you're 
carrying the rod which scares the bird, and so on. It's horribly 
complicated. Well, the following page goes into far greater detail than 
I ever could:

http://c2.com/cgi/wiki?WhyWeHateLisp
I daren't post this message on comp.lang.lisp you understand, as that 
would just be inviting Electric Death, as Douglas Adamas might say.




___ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Cale Gibbard
On 16/09/05, Mark Carter [EMAIL PROTECTED] wrote:
 This is not a troll, honest, so please bear with me ...
 
 I'm a C/C++/VBA programmer (although the former 2 are several years old
 for me), with a sprinkling of Python. Needless to say, I was looking to
 see if there were any better ways of doing things. I've given things
 like Ruby and Scheme a bit of peck, and failed to get particularly
 enthusiastic about them. Two very interesting choices, though, appear to
 be Lisp and Haskell. It struck me that Lisp was, perhaps, the Ultimate
 Programming Language, the One True Language to rule them all; except
 that I always kept  abandoning it for one reason or another (fiddly
 installation, lack of libraries, compatability problems,  cost, possible
 license issues, etc.). My current foray in Haskell seems encouraging.
 wxHaskell installed a breeze, and seems quite usable (even though I'm a
 raw n00b to the language, and admittedly haven't grokked the semantics,
 and all this  cid:part1.01000702.09000407@yahoo.co.uk IO a - IO ()
 business). On the one hand, it  seems kinda academic, but on the other,
 it looks like it wants to be practical, too.
 
 Bearing this in mind, and hoping you can see where I'm coming from, I
 think my question is: shouldn't you guys be using Lisp?
 
 

Well, there are a number of reasons which people might have for
choosing one over the other. I think you'll find that many Haskellites
are familiar with one or more variants of lisp and ML.

I'll try to provide some reasons that I find Haskell a fun and
pleasant programming language to write things in. (Actually, a fair
bit moreso than any other language that I've come across.)

One is that Haskell is lazily evaluated, and I really find that a lot
more natural than strict evaluation. It opens up a lot of ways of
writing code and thinking about code which would otherwise be
unavailable. In a strict language, you have to jump through some hoops
whenever infinite or very large amounts of data come along. You tend
to have to use different methods than you would for small data
structures in order to compute only small parts at any one time, and
throw away the parts that you're done with explicitly. In a lazy
language, a list is a list, and a tree is a tree, and the same
functions and techniques apply to them. Even if your data are
moderately sized, there are often times that the easiest algorithm to
write involves a large intermediate data structure, though you'll only
look at it one piece at a time, and maybe won't look at all of it.
With lazy evaluation, you're not penalized for doing things that way.

Of course, there are times when you really want strict evaluation, and
Haskell has ways to provide that. I find that they are relatively
rare.

Another reason is that it is statically type checked. The type system
in Haskell is quite expressive, and I find that it helps to catch bugs
to an incredible extent, and also to structure the way that you think
about code. With algebraic datatypes and the collection of standard
data structures in the libraries, you also don't lose very much
flexibility over dynamically typed structures.

The type system also helps you jump into unfamiliar code. People tend
to write Haskell code which uses types in order to distinguish and
catch those things which are obviously incorrect. When trying to sort
out how a piece of code works, or how to extend it, there is a
somewhat more restricted way that things could be fitting together at
any one point, so it's easier to figure out what's going on, and pin
down the places where you might want to extend things. You can often
go quite a long way in understanding code just by looking at the
types.

I also find that just through using Haskell, and being around the
Haskell community, I expose myself to a lot of exciting computer
science research. I'm still quite impressed that category theory has
found practical applications so quickly. :) Haskell people in general
seem to be experimenting with new kinds of abstractions and seeing how
far they can be taken in being put to practical use. Haskell itself
seems to be developing in directions which serve this experimentation,
and at the same time is becoming more and more practical.

Anyway, these are just some highlights of what I find fun about it,
and of course none of this is meant in any way to detract from all the
other great languages out there. Exploring different programming
languages is a lot of fun and can really expand the way that you think
about code. I encourage you to do so as much as possible.

 - Cale
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Glynn Clements

David Roundy wrote:

  Bearing this in mind, and hoping you can see where I'm coming from, I 
  think my question is: shouldn't you guys be using Lisp?
 
 Lisp is impure, weakly typed and has way too many parentheses.  Why would
 we use lisp? It seems to be lacking almost all the advantages of Haskell,
 and have an ugly, inflexible syntax to boot.

The ability to dynamically generate, manipulate and analyse code in a
structured manner provides a flexibility which is unmatched by any
other language I know of.

A good example is Emacs; lisp is entirely the right language for that,
IMHO.

-- 
Glynn Clements [EMAIL PROTECTED]
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Joel Reymont
I have faced these issues twice, always starting from Lisp and moving  
on somewhere else. There's more on my travails at http:// 
wagerlabs.com/tech and http://wagerlabs.com/uptick.


I implemented a poker engine in Lisp but it appeared that to deliver  
it on Windows, Linux and Mac OSX I would need to buy 3 commercial  
Lisp licenses. The total cost would have been about 4K euro +  
maintenance fees for LispWorks and about 18K USD + 25% maintenance  
fees for Allegro CL. Allegro also comes with royalties of less than  
10%. Windows Lisps are GPL so I could not use them.


What turned me off with poker was trying to write a Reliable UDP  
protocol handler and having a lot of trouble with threads and timers  
for some reasons. Fortunately, I discovered Erlang, quickly rewrote  
my poker backend and have been happy since. That is until I  
discovered Haskell :-). I'm now thinking of rewriting various chunks  
of the engine in Haskell (hand ranking for example) to see how it  
feels and what I gain. Concurrent Haskell coupled with transactional  
memory looks attractive as well.


I also started with Lisp for my trading systems project (Uptick) but  
was turned off even faster this time. I investigated what it would  
take to write code that overloaded +, *, etc. for arrays or lists and  
what it would take to optimize this code. It's possible but it's not  
elegant or pleasant.


I love a good challenge and the challenge of learning Haskell is like  
no other. It does require me to rewire my brain and to think  
different. There are a number of applications where Haskell fits  
nicely, google for papers on audio processing, robotics (Yampa), etc.  
I have yet to find an application where Lisp would shine over  
everything else.


Joel

On Sep 16, 2005, at 3:06 PM, Mark Carter wrote:

Alas, pulling against this seems to be a number of minuses. The  
commercial Lisp implementations may be good, but what wannabe  
hacker is going to fork out the cash for those babies? The free  
ones that work on Windows are GPL, which means that although  
somebody might be tempted to use them for personal projects, he is  
not going to sell the idea to his boss that stuff should be  
developed in Lisp.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Udo Stenzel
Mark Carter wrote:
 The free ones that work on 
 Windows are GPL, which means that although somebody might be tempted to 
 use them for personal projects, he is not going to sell the idea to his 
 boss that stuff should be developed in Lisp.

Nonsense.  The copyright notice for GNU CLisp specifically clarifies
that you are allowed to distribute your clisp programs, whether
interpreted or compiled, under any terms you like.  Just don't touch
clisp internals.  Accompany the program with the source for CLisp and
you are clear.

Anyway, I knew I didn't want to learn lisp when I heard that an
implementation is not required to optimize tail calls.  That means deep
recursions are unreliable.  A functional language in which you have
to iterate instead of recurse?  Impossible!


Udo.
-- 
Did you know that if you took all the economists in the world and lined
them up end to end, they'd still point in the wrong direction?


signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Wolfgang Jeltsch
Am Freitag, 16. September 2005 15:06 schrieb Mark Carter:
 Plus you can use macros to extend the language.

I don't know really about LISP macros but aren't they a bit like Template 
Haskell?

Since Haskell (even without Template Haskell) is a small but flexible language 
you can construct domain-specific langauges just by writing a library and 
using Haskell with this library as your domain-specific language.  I don't 
know LISP very much but I suppose that there are many things you can do in 
LISP which you can also do in Haskell.

Two big advantages of Haskell over LISP are lazy evaluation and its strong, 
flexible type system. Lazy evaluation makes the code a lot easier, cleaner, 
more functional.  Strong typing may be too restricting if the type system is 
not powerful enough.  But since Haskell's type system is very powerful, I 
practically never miss dynamic typing.

 [...]

Best wishes,
Wolfgang
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Wolfgang Jeltsch
Am Freitag, 16. September 2005 15:29 schrieb Glynn Clements:
 David Roundy wrote:
   Bearing this in mind, and hoping you can see where I'm coming from, I
   think my question is: shouldn't you guys be using Lisp?
 
  Lisp is impure, weakly typed and has way too many parentheses.  Why would
  we use lisp? It seems to be lacking almost all the advantages of Haskell,
  and have an ugly, inflexible syntax to boot.

 The ability to dynamically generate, manipulate and analyse code in a
 structured manner provides a flexibility which is unmatched by any
 other language I know of.

 A good example is Emacs; lisp is entirely the right language for that,
 IMHO.

Could you explain this a bit more, please?  To the moment, I cannot imagine 
cases where you need LISP's way of code analysis and manipulation because 
Haskell's capabilities are not sufficient.

In Haskell, code is data too because code in the sense of imperative actions 
is described by IO values.  You cannot analyse them.  But you can use your do 
expressions etc. to construct action descriptions with a more general type 
like MonadIO m = m a.  Then you can instantiate m with a monad whose values 
store part of the action's structure so that this information can be used 
later.  Or you use a monad which doesn't keep structural information to use 
it for later processing but which does the processing upon construction.

Best wishes,
Wolfgang
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Creighton Hogg
On Fri, 16 Sep 2005, Mark Carter wrote:

 This is not a troll, honest, so please bear with me ...
 
 I'm a C/C++/VBA programmer (although the former 2 are several years old 
 for me), with a sprinkling of Python. Needless to say, I was looking to 
 see if there were any better ways of doing things. I've given things 
 like Ruby and Scheme a bit of peck, and failed to get particularly 
 enthusiastic about them. Two very interesting choices, though, appear to 
 be Lisp and Haskell. It struck me that Lisp was, perhaps, the Ultimate 
 Programming Language, the One True Language to rule them all; except 
 that I always kept  abandoning it for one reason or another (fiddly 
 installation, lack of libraries, compatability problems,  cost, possible 
 license issues, etc.). My current foray in Haskell seems encouraging. 
 wxHaskell installed a breeze, and seems quite usable (even though I'm a 
 raw n00b to the language, and admittedly haven't grokked the semantics, 
 and all this  cid:part1.01000702.09000407@yahoo.co.uk IO a - IO () 
 business). On the one hand, it  seems kinda academic, but on the other, 
 it looks like it wants to be practical, too.
 
 Bearing this in mind, and hoping you can see where I'm coming from, I 
 think my question is: shouldn't you guys be using Lisp?


As someone else that has been learning both Haskell and 
Lisp, I think you should really look at Haskell as a 
wonderful experiment.  Essentially, while Lisp can do pretty 
much anything, it isn't perfect and shouldn't be the last 
word., I don't think we should be satisfied with a language just 
the way it is.  Haskell is very, very different than most languages.  
It's *purely* functional and lazy evaluating.  The latter is 
most interesting to me from the compiler writing aspect.  
When I have a little more free time and a little more 
experience I'd love to have a deeper look at ghc and 
understand how it works.
In essence though, I think that Haskell is worth learning 
simply because it tries something different.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Mark Carter

Wolfgang Jeltsch wrote:


Am Freitag, 16. September 2005 15:06 schrieb Mark Carter:
 


Plus you can use macros to extend the language.
   



I don't know really about LISP macros but aren't they a bit like Template 
 

I wrote a Lisp macro once, and realised that it had a power that I 
hadn't seen before (the actual problem I was trying to solve that I 
wanted a logger that, given a variable, printed its name and value). 
That represented my one dip into Lisp macros, so it's fair to say that 
I'm not qualified to talk on either of Lisp or Haskells metaprogramming 
facilities. All I know is, if Haskell Templates provide no greater power 
than those of C++, be prepared for the Lispers to be, shall we say,  
somewhat condescending about them. ;)




___ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread David Roundy
On Fri, Sep 16, 2005 at 02:29:33PM +0100, Glynn Clements wrote:
 David Roundy wrote:
   Bearing this in mind, and hoping you can see where I'm coming from, I
   think my question is: shouldn't you guys be using Lisp?
  
  Lisp is impure, weakly typed and has way too many parentheses.  Why
  would we use lisp? It seems to be lacking almost all the advantages of
  Haskell, and have an ugly, inflexible syntax to boot.
 
 The ability to dynamically generate, manipulate and analyse code in a
 structured manner provides a flexibility which is unmatched by any
 other language I know of.

True, if you want to write code to modify code, lisp would be nice
(everything is a list)... but that's related to my problem with its syntax.
Lisp seems to be designed for machines to parse easily without regard to
ease of human parsing.  That seems backwards to me.  On one level, an
objection to syntax is pretty lame, but on the other hand,

CAVEAT: I know nothing about lisp macros... my lisp knowledge is basically
from one course over ten years ago, plus some experience with configuring
emacs and with a photonics code (mpb) that used guile for its input files.
-- 
David Roundy
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Jacques Carette

Glynn Clements wrote:


Every other language (including Haskell) tends to have the problem
that eventually you will encounter a situation where the language's
own worldview gets in the way.

Or, to put it another way: if Haskell is so flexible, why do we need
Template Haskell? I can't imagine a Template Lisp; it would just be
Lisp.
 

I was just about to say something very similar.  So to add a new point:  
Why is there a partial evaluator for full Scheme 
(http://www.informatik.uni-freiburg.de/proglang/software/pgg/) but none 
for full Haskell (or full ML for that matter)?  The problem is 
considerably harder - see the papers listed at 
http://partial-eval.org/scheme_pe.html.


The issue there is definitely one of worldview.  The Haskell type system 
(and the ML type system as well) have a wordview that is incompatible 
with very powerful code manipulations.  That is why Template Haskell is 
*untyped*, and why MetaOCaml (www.metaocaml.org) puts serious 
restrictions on what can be done with code so as to prevent unsoundness.


However, Gilmore's work on Intensional Type Theory 
(http://www.cs.ubc.ca/spider/gilmore/) looks very promising to me as a 
method to attack this worldview problem.  Others have tried to use modal 
logic (mostly S4), but I personally don't believe that is the right way 
to go.


Jacques

PS: yes, I know about 
http://www.cs.chalmers.se/~rjmh/PECourse/Exercises/PE.html and 
http://www.informatik.uni-freiburg.de/proglang/research/software/mlope/.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[2]: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Bulat Ziganshin
Hello Wolfgang,

Friday, September 16, 2005, 6:30:45 PM, you wrote:

WJ more functional.  Strong typing may be too restricting if the type system is
WJ not powerful enough.  But since Haskell's type system is very powerful, I 
WJ practically never miss dynamic typing.

really, we have dunamic typing in current GHC:

1) rank-2 types
2) Data.Dynamic



-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[2]: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Bulat Ziganshin
Hello Mark,

Friday, September 16, 2005, 7:42:46 PM, you wrote:
MC facilities. All I know is, if Haskell Templates provide no greater power
MC than those of C++, be prepared for the Lispers to be, shall we say,  
MC somewhat condescending about them. ;)

Template Haskell has nothing common with C templates, it's îíûå a
typeful UNIVERSAL preprocessor. C templates equivalent to Haskell
polymorhic procedures/types, which exist from the language start



-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread David F. Place


On Sep 16, 2005, at 6:26 PM, Glynn Clements wrote:


Haskell's safety and
consistency can get in the way, while Lisp's freedom can be quite
unsafe and inconsistent.


I have many years of experience designing and implementing commercial  
software in lisp and I strongly agree with the second part of this  
sentence.   However, my more recent experience with Haskell makes me  
doubt very much the first part.  Haskell's powerful type system  
hasn't in the least cramped my style and lazy evaluation eliminates  
99% of the need for macros in lisp.   (The other 1% is syntactic  
sugar of doubtful utility.) Since Haskell supports recursive  
polymorphic types it can easily handle all of the metaprogramming  
problems where lisp first made its mark.


I don't see any reason to continue to use lisp.

ps. This thread was on Haskell-cafe which seems more appropriate, so  
I'm bringing it back.



David F. Place
mailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe