Re: [Haskell-cafe] Toy application advice wanted

2004-05-05 Thread Vincenzo aka Nick Name
On Wednesday 05 May 2004 04:46, Ben Lippmeier wrote:
 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.

The fact that the 16th one is a wxwindows binding justifies this quite 
well :)

V.

-- 
Si puo' vincere una guerra in due e forse anche da solo
si puo' estrarre il cuore anche al piu' nero assassino
ma e' piu' difficile cambiare un' idea
[Litfiba]

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


Re: [Haskell-cafe] Toy application advice wanted

2004-05-05 Thread Frank Atanassow
On May 3, 2004, at 5:52 PM, [EMAIL PROTECTED] wrote:
I've got an interesting task this week for my job.  (Note that this 
will undoubtably last for longer than a week).  I'm evaluating several 
high-level languages as development vehicles for our next suite of 
applications.  The languages I'm currently considering are Scheme, 
Erlang, and Haskell...

The toy application I've designed for myself is a simple GUI-based 
app that can load a Sun .au format sound file, display its waveform in 
a window, perform some simple filtering, play the sound for the user, 
and then save the changed sound file back out to disk.  If I get 
familiar enough with the respective environments I'd like to add 
zooming in/out and scrolling to the waveform display...

I have an amortized four days (32 hours!!!) to implement this simple 
application in Haskell...

Any advice/pointers/flames welcome.  Thanks in advance.
Frankly, I think it's completely unrealistic to expect to be able to 
fairly evaluate Haskell in 32 hours. As you noted yourself, Scheme and 
Erlang, being strict, are much closer to conventional programming 
languages than Haskell is, so it's easier to transfer skills to them. 
Furthermore, they're untyped, and learning how to exploit Haskell's 
static typing is one of the bigger hurdles to learning how to exploit 
Haskell.

Even if, as you wrote in a later post, you lower your sights to 
something less ambitious than a full-blown GUI app (which I think is a 
good idea), it's hard get a grasp on concepts like laziness, recursive 
datatypes, parametric polymorphism, monads, type classes and so on in 
less than a week, even for experienced programmers. At best, I imagine 
you'll come away curious and hungry for more; but clearly that doesn't 
suffice for a language evaluation.

Of course, the fact that Haskell can't be grasped in a day (or week) 
can be construed as a practical argument against its adoption. On the 
other hand, if you accept that there's no such thing as a free lunch, 
you might consider that a merit; what is the point of adopting a new 
language if it doesn't change the way you think about programming, and 
let you write old programs in new, perhaps better, ways? [1]

While Haskell is IMO the best programming language around, and I want 
to encourage its broader adoption, if you want a well-designed language 
with good implementation and support which permits swifter skill 
transfer, may I (strongly) recommend you add Objective Caml to your 
list of candidates? Once you acquire some experience with an ML-like 
language such as OCaml, which after all resembles Haskell in many ways, 
you will, I believe, find yourself better equipped to evaluate Haskell.

Regards,
Frank
[1] Think about polynomials and real numbers. Complex numbers were, I 
believe, invented specifically to ensure that every polynomial equation 
has a solution. So, to address some problems, we need to take a step 
backward before we can take one forward.

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


Re: [Haskell-cafe] Toy application advice wanted

2004-05-05 Thread Andrei de A. Formiga

   I'm finding wxHaskell very nice, and a wxWidgets
binding is something many other advanced languages
don't have (even OCaml). The only downside is having a
'Hello World' GUI application with 7 Mb... but it runs
quite well and smooth once it's loaded.

---
[]s, Andrei de A. Formiga


--- Vincenzo aka Nick Name
[EMAIL PROTECTED] wrote:
 The fact that the 16th one is a wxwindows binding
 justifies this quite 
 well :)
 
 V.
 





__
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Toy application advice wanted

2004-05-05 Thread Lyle Kopnicky
David Roundy wrote:
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...
A one-liner:
main = interact (show . length . lines)
- Lyle Kopnicky
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Toy application advice wanted

2004-05-05 Thread mikeb
On Wed, 5 May 2004, Frank Atanassow wrote:

 Frankly, I think it's completely unrealistic to expect to be able to
 fairly evaluate Haskell in 32 hours. As you noted yourself, Scheme and
 Erlang, being strict, are much closer to conventional programming
 languages than Haskell is, so it's easier to transfer skills to them.

Yeah, I'm starting to see the difficulty in recommending a language I can
barely dabble in up the chain (not as bad as pointy hair bosses, but still
not computer scientists).

 Furthermore, they're untyped, and learning how to exploit Haskell's
 static typing is one of the bigger hurdles to learning how to exploit
 Haskell.

That was one of the things that attracted me to Haskell...the type system.
I enjoyed strong typing in ML when I played with it in college.

 At best, I imagine
 you'll come away curious and hungry for more; but clearly that doesn't
 suffice for a language evaluation.

Certainly.

 Of course, the fact that Haskell can't be grasped in a day (or week)
 can be construed as a practical argument against its adoption. On the
 other hand, if you accept that there's no such thing as a free lunch,
 you might consider that a merit; what is the point of adopting a new
 language if it doesn't change the way you think about programming, and
 let you write old programs in new, perhaps better, ways? [1]

This is the crux of the argument.  I don't understand how we can make good
programming languages more popular.  My son was born just a couple of
weeks ago, and I barely have enough time now to keep up with anything in
my career/field; I was lucky I convinced my management to let me do a
(too-)  brief language survey.  But without having thought in Haskell
for at least a couple of months, how can I hope to promote it
successfully?  How can I get a couple of months proficiency in Haskell
unless I've promoted it successfully?  (Co-routines? =)

 While Haskell is IMO the best programming language around, and I want
 to encourage its broader adoption, if you want a well-designed language
 with good implementation and support which permits swifter skill
 transfer, may I (strongly) recommend you add Objective Caml to your
 list of candidates? Once you acquire some experience with an ML-like
 language such as OCaml, which after all resembles Haskell in many ways,
 you will, I believe, find yourself better equipped to evaluate Haskell.

Thanks for this...I actually just added ocaml to my list last night.  I
was looking over the programming languages shootout and read some of the
source.  It looks pretty neat.

I spent last night writing a simple object system from scratch in Scheme
with macros, and starting thinking about all the things I'd have to do to
implement any kind of type safety, and it just sort of clicked that ocaml
might be an interesting solution.

Thanks again for your comments (and everyone's).

--
Mike J. BellThis is all just my opinion.
Outside of a dog, a book is man's best
friend.  Inside it's too dark to read.  [EMAIL PROTECTED]
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] HDirect, [unique], troubles again!

2004-05-05 Thread Vincenzo aka Nick Name
In my quest for a fuse binding for Haskell, which I really need at the 
moment, I have the following definition working:

module HSFuse {
  interface stat{};
  
  typedef int getattrT([string] char *,stat);

  typedef struct fuseOps {
[ref] getattrT * getattr;
  } fuseOps;

  void fuse_main(int argc,[in,string,size_is(argc)]char** argv,[ref] 
fuseOps * op);
};

but when I substitute ref with unique, because some operations can 
be null, I get the errors below. The problem is that in the generated 
hs file there is

data FuseOps = FuseOps {getattr :: GetattrT}

which completely ignores my type declaration! Did I do something wrong?

Commands invoked and errors follow, thanks for attention:

ihc -fhs-to-c -fuse-ints-everywhere -c HSFuse.idl
ghc  -package hdirect -fglasgow-exts HSFuse.hs -c

HSFuse.hs:136:
Couldn't match
`GHC.Base.String - Stat - GHC.IOBase.IO GHC.Base.Int'
against
`GHC.Ptr.Ptr
 (GHC.Base.String - Stat - GHC.IOBase.IO GHC.Base.Int)'
Expected type: GHC.Ptr.Ptr
   (GHC.Ptr.Ptr
(GHC.Base.String - Stat - 
GHC.IOBase.IO GHC.Base.Int))
   - GHC.Ptr.Ptr
  (GHC.Base.String - Stat - GHC.IOBase.IO 
GHC.Base.Int)
  - GHC.IOBase.IO ()
Inferred type: GHC.Ptr.Ptr
   (GHC.Ptr.Ptr
(GHC.Base.String - Stat - 
GHC.IOBase.IO GHC.Base.Int))
   - (GHC.Base.String - Stat - GHC.IOBase.IO 
GHC.Base.Int)
  - GHC.IOBase.IO ()
In the second argument of `HDirect.writeunique', namely
`writeGetattrT'
In the definition of `writeFuseOps':
writeFuseOps ptr (FuseOps getattr)
   = let
   pf0 = ptr
   pf1 = HDirect.addNCastPtr pf0 0
 in
   HDirect.writeunique (HDirect.allocBytes 
(GHC.Real.fromIntegral sizeofGetattrT))
   writeGetattrT
   pf1
   getattr

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