[ocaml-biz] strategy bullet point list
Brian Hurt
bhurt
Mon Aug 30 16:11:18 PDT 2004
On Mon, 30 Aug 2004, William D. Neumann wrote:
> On Mon, 30 Aug 2004, Brandon J. Van Every wrote:
>
> Two minor points:
>
> > - C++ is neither high level nor type safe. Java and C# do not offer
> > performance, and OCaml is better at HLL features and type safety.
>
> I really know jack about C#, so there may be a simple, valid counterpoint,
> but if one looks at the recently revived language shootout
> <http://shootout.alioth.debian.org/index.php>, C# ranks ahead of OCaml in
> raw speed. So if we're going to claim that C# does not offer performance,
> we're going to have to come up with a valid explanation of why it ranks
> ahead of OCaml on that scorecard...
Well, first of all, no one is optimizing the Ocaml code- while other
languages are getting optimized. From my following of the mailing list,
C++ and C# are especially active. Second, I'm wondering how csharp got a
score of 39.9, when the next non-natively-compiled language (Java/Kaffe)
came in 10 steps and 13.1 points. Sun's Java is another 4 steps and 0.5
points down from Kaffe. I think the question is not "why is Ocaml lower
than C#", the question is "why is C# so much higher performance than Java,
Ocaml byte code, and other byte code interpreted languages?"
I suspect that some proscribed optimization is being performed- like the
environment has noticed that results are simply be thrown away, and thus
it isn't computing them. I don't know this for sure, but I suspect it.
My other answer to that is:
http://shootout.alioth.debian.org/craps.php?xcpu=0&xmem=1&xloc=0&ackermann=1&ary=3&echo=5&except=1&fibo=2&hash=1&hash2=4&heapsort=4&hello=1&lists=3&matrix=3&methcall=5&moments=2&nestedloop=4&objinst=5&prodcons=1&random=3®exmatch=4&reversefile=4&ringmsg=1&sieve=4&spellcheck=4&strcat=2&sumcol=3&wc=3&wordfreq=5
and:
http://shootout.alioth.debian.org/craps.php?xcpu=0&xmem=0&xloc=1&ackermann=1&ary=3&echo=5&except=1&fibo=2&hash=1&hash2=4&heapsort=4&hello=1&lists=3&matrix=3&methcall=5&moments=2&nestedloop=4&objinst=5&prodcons=1&random=3®exmatch=4&reversefile=4&ringmsg=1&sieve=4&spellcheck=4&strcat=2&sumcol=3&wc=3&wordfreq=5
I comment that in terms of memory used, Ocaml scores 43.4 while C# scores
11.1, and in terms of lines of code, Ocaml scores 45.8 while C# scores
26.4. If absolute speed (and minimal memory usage) is needed, you want C.
Note that even C++ is signifigantly slower than C.
--
"Usenet is like a herd of performing elephants with diarrhea -- massive,
difficult to redirect, awe-inspiring, entertaining, and a source of
mind-boggling amounts of excrement when you least expect it."
- Gene Spafford
Brian
More information about the Ocaml-biz
mailing list