From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id C165DBB81 for ; Sun, 9 Oct 2005 19:25:45 +0200 (CEST) Received: from mail.physik.uni-muenchen.de (mail.physik.uni-muenchen.de [192.54.42.129]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j99HPjMC010357 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Sun, 9 Oct 2005 19:25:45 +0200 Received: from localhost (unknown [127.0.0.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id C82172000C; Sun, 9 Oct 2005 19:25:44 +0200 (CEST) Received: from mail.physik.uni-muenchen.de ([127.0.0.1]) by localhost (mail.physik.uni-muenchen.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 18736-01-46; Sun, 9 Oct 2005 19:25:44 +0200 (CEST) Received: from mailhost.cip.physik.uni-muenchen.de (kaiser.cip.physik.uni-muenchen.de [141.84.136.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id A3A2E20004; Sun, 9 Oct 2005 19:25:44 +0200 (CEST) Received: from eiger.cip.physik.uni-muenchen.de (eiger.cip.physik.uni-muenchen.de [141.84.136.54]) by mailhost.cip.physik.uni-muenchen.de (Postfix) with ESMTP id AA06326F4D; Sun, 9 Oct 2005 19:25:43 +0200 (CEST) Received: by eiger.cip.physik.uni-muenchen.de (Postfix, from userid 3092) id 99DA612F75; Sun, 9 Oct 2005 19:25:43 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by eiger.cip.physik.uni-muenchen.de (Postfix) with ESMTP id 9461312F17; Sun, 9 Oct 2005 19:25:43 +0200 (CEST) Date: Sun, 9 Oct 2005 19:25:43 +0200 (CEST) From: Thomas Fischbacher To: Jon Harrop Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Ray tracer language comparison In-Reply-To: <200510091558.16826.jon@ffconsultancy.com> Message-ID: References: <200510040018.24932.jon@ffconsultancy.com> <200510091558.16826.jon@ffconsultancy.com> X-BOFH: Daemons did it MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: amavisd-new at physik.uni-muenchen.de X-Miltered: at nez-perce with ID 43495299.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 tuareg:01 columns:01 columns:01 bug:01 printf:01 parentheses:01 parens:01 ocaml:01 rewrote:01 printf:01 downto:01 ocaml:01 2005,:98 26,:98 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_FAIL autolearn=disabled version=3.0.3 On Sun, 9 Oct 2005, Jon Harrop wrote: > On Sunday 09 October 2005 06:26, you wrote: > > http://www.cip.physik.uni-muenchen.de/~tf/raytracer/ > > I reformatted your code with tuareg indentation and 80-char columns to conform > with the other implementations for fair comparison, The longest line in your original code has 79 columns. So does the longest line in my code. I do not use any indentation and formatting techniques which are not present in your original code as well. > corrected the bug in a > call to printf and removed the superfluous parentheses. Yes, I was notified of this as well and corrected it in the source. Concerning teh extra parens: I like them. Let's just consider this artisitc freedom, okay? > Your code is then 1 > line shorter and 8x slower than the previous implementation on my site. What do you mean, "previous implementation"? You provide data for OCaml, and I suggested you should include Objective Caml into the comparison as well. > I then rewrote it to be both shorter and faster. Let us see: > Printf.printf "P5\n%d %d\n255\n" n n;; > for y = n - 1 downto 0 do > for x = 0 to n - 1 do > let g = ref 0. in > for dx = 0 to ss - 1 do Ah. You eliminated the main function. Nice move. I suppose one could easily do this for the other implementations as well. As some people out there seem to wonder what this is all about: I maintain the following claim. - While Jon does not clearly state this on his web page, his main criterion for a valid submission is that it must be impossible to improve by making it both shorter and faster. - The problem with this methodology is that it does not satisfy even the most fundamental principle one would like to see in a proper comparison: If we take a product X, and a product Y, which in fact just again is X, but let us pretend for now and threat them as if they were different, then it must not be possible to make a submission for X and a submission for Y that both are valid under all the criteria applied, which lead to the conclusion that X is considerably better than Y. Okay, Jon, you just managed to produce an Objective Caml implementation which shows that I am completely wrong, and indeed, Objective Caml is even much more succinct than OCaml, while being only about 50% slower than OCaml. Why don't you include that important result on your web page? -- regards, tf@cip.physik.uni-muenchen.de (o_ Thomas Fischbacher - http://www.cip.physik.uni-muenchen.de/~tf //\ (lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y) V_/_ (if (= x 0) y (g g (- x 1) (* x y)))) n 1)) (Debian GNU)