From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id DAA25708; Fri, 18 Jun 2004 03:18:27 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id DAA24397 for ; Fri, 18 Jun 2004 03:18:25 +0200 (MET DST) Received: from mproxy.gmail.com (mproxy.gmail.com [216.239.56.252]) by nez-perce.inria.fr (8.12.10/8.12.10) with SMTP id i5I1INEV031780 for ; Fri, 18 Jun 2004 03:18:24 +0200 Received: by mproxy.gmail.com with SMTP id r62so90485cwc for ; Thu, 17 Jun 2004 18:18:23 -0700 (PDT) Received: by 10.11.119.1 with SMTP id r1mr222578cwc; Thu, 17 Jun 2004 18:18:23 -0700 (PDT) Message-ID: <891bd3390406171818585e3edd@mail.gmail.com> Date: Thu, 17 Jun 2004 21:18:23 -0400 From: Yaron Minsky Reply-To: yminsky@cs.cornell.edu To: Brian Hurt Subject: Re: [Caml-list] Great Programming Language Shootout Revived Cc: Ocaml Mailing List In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: X-Miltered: at nez-perce with ID 40D242DF.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; yaron:01 minsky:01 yminsky:01 caml-list:01 shootout:01 2004:99 cdt:99 line-counts:01 shootout:01 argv:01 argv:01 printf:01 printf:01 ocaml:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 17 Jun 2004 13:05:12 -0500 (CDT), Brian Hurt 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