caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Yaron Minsky <yminsky@gmail.com>
To: Brian Hurt <bhurt@spnz.org>
Cc: Ocaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Great Programming Language Shootout Revived
Date: Thu, 17 Jun 2004 21:18:23 -0400	[thread overview]
Message-ID: <891bd3390406171818585e3edd@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0406171237270.4305-100000@localhost.localdomain>

On Thu, 17 Jun 2004 13:05:12 -0500 (CDT), Brian Hurt <bhurt@spnz.org> wrote:

> What's starting to happen, now that the project has started up again, is
> advocates/supporters of other languages have started to submit improved
> versions of the code for their languages.  For example, I notice that
> Ocaml has dropped from it's #1 place in least lines of code to #2, with
> Ruby taking the lead.

For what it's worth, the ocaml line-counts in the shootout are
particularly bogus.  There are lots of examples where the ocaml code
does things like putting entire for loops (or even nested for loops!)
on a single line.  Here's an example:

let _ =
  let n = if Array.length Sys.argv > 1 then int_of_string Sys.argv.(1) else 1 in
  let lix = n - 1 and x = Array.make n 0 and y = Array.make n 0 in
  for i = 0 to lix do x.(i) <- i + 1 done;
  for k = 0 to 999 do for i = lix downto 0 do y.(i) <- x.(i) + y.(i) done done;
  Printf.printf "%d %d\n" y.(0) y.(lix)

The code is perfectly reasonable, but it would be a hell of a lot more
readable and idiomatic if it was on 16 lines instead of 6.  The other
languages in the shootout appear to engage in less of this tomfoolery.
 Personally, I think the ocaml entries should be fixed to have more
lines of code.  As it is, the examples make ocaml look much more
obscure that it is.

y

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2004-06-18  1:18 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-17 18:05 Brian Hurt
2004-06-18  1:18 ` Yaron Minsky [this message]
2004-06-18  9:37   ` Sebastien Ferre
2004-06-18 15:45     ` Brian Hurt
2004-06-18 21:39       ` Eray Ozkural
2004-06-18  6:09 ` Brandon J. Van Every
2004-06-18  7:56 ` Ville-Pertti Keinonen
2004-06-18  8:59   ` skaller
2004-06-18  9:57     ` Ville-Pertti Keinonen
2004-06-18 10:48       ` Implementing DSLs in OCaml/CamlP4 (was: Re: [Caml-list] Great Programming Language Shootout Revived) Richard Jones
2004-06-18 12:32         ` Walid Taha
2004-06-18 15:38   ` [Caml-list] Great Programming Language Shootout Revived Brian Hurt
2004-06-18 17:07     ` David Brown
2004-06-19  0:26   ` Nicolas FRANCOIS
2004-06-19  9:04     ` [Caml-list] Benchmark suggestion (Was: Programming Language Shootout) Wolfgang Müller
2004-06-19 10:54       ` Ville-Pertti Keinonen
2004-06-19 19:38       ` [Caml-list] Benchmark suggestion Brandon J. Van Every
2004-06-19 20:08         ` Brian Hurt
2004-06-19 20:16         ` Wolfgang Müller
2004-06-20 11:24           ` [Caml-list] Evangelism Brandon J. Van Every
2004-06-19 11:18     ` [Caml-list] Great Programming Language Shootout Revived Ville-Pertti Keinonen
2004-06-19 11:56     ` Nicolas Janin
2004-06-19 12:51       ` Marcin 'Qrczak' Kowalczyk
2004-06-19 19:46         ` Brandon J. Van Every
2004-06-19 20:19           ` Brian Hurt
2004-06-19 12:09     ` Nicolas Janin
2004-06-19 12:48       ` John Hughes
2004-06-19 18:57       ` Brian Hurt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=891bd3390406171818585e3edd@mail.gmail.com \
    --to=yminsky@gmail.com \
    --cc=bhurt@spnz.org \
    --cc=caml-list@inria.fr \
    --cc=yminsky@cs.cornell.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).