Re: [Haskell-cafe] Toy application advice wanted

2004-05-04 Thread Ben Lippmeier
Mike,

I'm evaluating several high-level languages as development 
vehicles for our next suite of applications. 

.. just code some really simple problems.
Like the Sieve of Eratosthenes, in all three languages.
Or a simple publish/subscribe framework with a "master"
state holder and many slaves. Or quicksort.  Etc. etc.
I would be careful about using your experience with these toy programs 
as an indication of how suitable functional languages (and lazy ones 
in-particular) are as 'development vehicles' for your applications.

A functional programmer's idea of a 'toy' program tends to be somewhat 
different from a C++/GUI programmers one. Lazy functional languages lend 
themselves nicely to parsing, list processing, search trees and the like 
- but if you're planning to load a wave file, apply a filter and then 
display the result on the screen .. then let's just say that you've got 
an adventure ahead of you, and it's not going to take 2 weeks.

... as far as GUIs are concerned, check out 
http://www.haskell.org/libraries and look at how many seperate GUI 
libraries there are - I counted 16 - then ask what made the developer 
for the 16th one choose to start over.

Haskell is lazy all the time.  That's awfully nice...I'm not sure if
there's a performance penalty somewhere, but assuming there isn't, kudos
to it.
There is.. and its name is 'space leak'.. and the function
mapAccumL :: (acc -> x -> (acc, y)) -> acc -> [x] -> (acc, [y])
is by far the most elegant way of expressing it :)
BTW: I've just dedicated the next 3 years of my life to trying to write 
non-toy programs in lazy functional languages... "adventure" is the 
operative word.. not "can't".

Ben.

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


Re: [Haskell-cafe] Toy application advice wanted

2004-05-04 Thread David Roundy
On Mon, May 03, 2004 at 11:27:41PM -0400, [EMAIL PROTECTED] wrote:
> Anyway, I'm starting to ramble, but I talked to a friend who has similar
> feelings but is actually pretty good at Common Lisp.  He suggested I
> refocus my energies, and I agree:  instead of biting off more than I can
> chew, and having to learn a whole wad of APIs that aren't really about the
> language (read: wxHaskell or gtk2hs/the like, or audio packages etc.),
> just code some really simple problems.
> 
> Like the Sieve of Eratosthenes, in all three languages.  Or a simple
> publish/subscribe framework with a "master" state holder and many slaves.
> Or quicksort.  Etc. etc.
> 
> So I'm going to head down that path right now, and try to get a feel for
> the languages in a slightly more pure fashion.  I'll still try to get
> performance metrics out of them, but I'm not going to bang my head against
> the wall learning new languages, GUI toolkits, and FFIs all in two weeks.

I think that sounds like a good idea (not doing a GUI just yet) but would
recommend that perhaps you could do something pretty impure in terms of
file or directory browsing.  That wouldn't involve going beyond the
standard libraries, but might give you some idea of the expressive power of
the languages in terms of IO actions.  I'm thinking something like a
recursive grep, or wc -l... except preferably a bit more tailored to the
sort of IO you'll have to do in your actual application.  I guess the trick
would be in finding something tough enough, since wc -l would be something
like a two-liner...
-- 
David Roundy
http://www.abridgegame.org/darcs
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe