Are there major inefficiencies in Haskell compared to OCaml?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Are there major inefficiencies in Haskell compared to OCaml?

caseyh
Are there major inefficiencies in Haskell compared to OCaml?
If so, can something be done about them?
--
Regards,
Casey
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Are there major inefficiencies in Haskell compared to OCaml?

Don Stewart-2
caseyh:
> Are there major inefficiencies in Haskell compared to OCaml?
> If so, can something be done about them?

Can you be more specific?

Looking at the u64q shootout:

    http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=ghc&lang2=ocaml&box=1

Shows the two implementations tied for memory, and code size, but
Haskell winning the speed tests more often.

-- Don
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Are there major inefficiencies in Haskell compared to OCaml?

Rick Richardson
In reply to this post by caseyh

On Fri, Dec 4, 2009 at 4:25 PM, Casey Hawthorne <[hidden email]> wrote:
Are there major inefficiencies in Haskell compared to OCaml?
If so, can something be done about them?


There are definitely some gotchas when it comes to performance, mostly in the realm of inadvertent space leaks and such.
But that's just it, they are gotchas. A new haskeller will no doubt encounter them, but they are generally simple to fix.

When Haskell and Ocaml are coded by their respective experts, I would, in general, trust Haskell to be faster.



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Are there major inefficiencies in Haskell compared to OCaml?

Erik de Castro Lopo-34
In reply to this post by caseyh
Casey Hawthorne wrote:

> Are there major inefficiencies in Haskell compared to OCaml?

As a five plus year veteran of Ocaml and a one year user of Haskell
I would say in general no.

However, Ocaml's strict evaluation makes it easy for someone new to
the language to have a pretty accurate guess about its run time and
memory usage something which can be difficult in the face of Haskell's
lazy evaluation (not that I have experienced any obvious manifestations
of this myself).

Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Are there major inefficiencies in Haskell compared to OCaml?

M Xyz


However, Ocaml's strict evaluation makes it easy for someone new to
the language to have a pretty accurate guess about its run time and
memory usage something which can be difficult in the face of Haskell's
lazy evaluation (not that I have experienced any obvious manifestations
of this myself).

Erik

Speaking as "someone new to the language", this is one subject that confused me while reading RWH. They kept using the phrase "space leak" and I would think "Well, I understand that with laziness one simple call could trigger an explosion of calculations but how is that a 'leak'?"

I had to go back and reread that section before I realized that the laziness was implemented as *runtime thunks* and I finally understood why they called it a "leak". Looking back I think they did a good job explaining it after all, I just totally missed it the first time through.



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe