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 178B1BB81 for ; Fri, 24 Mar 2006 23:30:45 +0100 (CET) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.197]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k2OMUiUF020814 for ; Fri, 24 Mar 2006 23:30:44 +0100 Received: by zproxy.gmail.com with SMTP id i11so1088414nzi for ; Fri, 24 Mar 2006 14:30:43 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=RbcWMzyLJdDHZFiG3RgI6I1/kAQRWblY8aHxWvtEzMOK8M8l5P9rjC2mXEskklgsXD+aj2iE50W5bxMv/TLx/xdZezQvsgtaW3Hoq21h7C4BoiVekJudv3f2AqGqwVmypvNvppy8zJSw5m7sUPraxTV6XMT3PpNuFScP0T5cHW4= Received: by 10.36.119.4 with SMTP id r4mr1818017nzc; Fri, 24 Mar 2006 14:30:43 -0800 (PST) Received: by 10.36.100.4 with HTTP; Fri, 24 Mar 2006 14:30:43 -0800 (PST) Message-ID: Date: Fri, 24 Mar 2006 14:30:43 -0800 From: "Nathaniel Gray" To: "Mike Lin" Subject: Re: [Caml-list] Another great advantage for OCaml language due to Markus Mottl Cc: caml-list@yquem.inria.fr In-Reply-To: <2a1a1a0c0603210823k6833a073k753bffe306b2430c@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <2a1a1a0c0603210823k6833a073k753bffe306b2430c@mail.gmail.com> X-Miltered: at nez-perce with ID 44247314.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 markus:01 mottl:01 mikelin:01 compiler:01 ocaml:01 backtrace:01 ocamlopt:01 compiler:01 markus:01 mottl:01 byte:01 debugging:01 byte:01 unhandled:01 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=RCVD_BY_IP autolearn=disabled version=3.0.3 Yes, please! On 3/21/06, Mike Lin wrote: > Now that it exists, I strongly second incorporating it (as a compiler > switch) into the official release. ASAP. IMHO untraceable exceptions > have been one of the worst things about native code OCaml for a very > long time. > > On 3/21/06, Andries Hekstra wrote: > > > > Dear Member of the OCaml mailing list, > > > > The problem about which I reported on this reflector around two weeks a= go > > (array index violation after around 4 days) has in the mean time been s= olved > > thanks to the great native function call backtrace for the ocamlopt com= piler > > due to Markus Mottl. Given that my program crashed after 3.7 days, and = my > > program ran around 30x slower in byte code, debugging using byte code w= as > > not an option (this slowdown had been similar if I had used _DEBUG mode= of a > > C++ program instead of _RELEASE version). Also, as reported earlier, pu= tting > > "try ... with " around all attempts to index an array is not feasbile i= n > > standard OCaml for array elements in the left hand sides of assignments= . A > > static unhandled exception checker provided on a web page, ran into dea= d > > HTML links. > > > > Hence, the native function call, which comes at minimal runtime overhea= d > > cost, mainly the cost of -inline 0, is a great new feature that would g= ive > > OCaml another advantage over C++ when added to the OCaml language in a = next > > release. Below I give a toy example : > > > > --- nlv13512/TestProgram ---> ls > > attempt.ml* > > --- nlv13512/TestProgram ---> cat att* > > let a =3D Array.make 2 0;; > > let f i =3D i*i;; > > let g i =3D a.(i);; > > let b =3D f 2;; > > let c =3D g 2;; > > --- nlv13512/TestProgram ---> ocamlopt -inline 0 -gb attempt.ml > > --- nlv13512/TestProgram ---> a.out > > Fatal error: exception Invalid_argument("index out of bounds") > > Native function backtrace: > > > > camlAttempt__g_60 > > camlAttempt__f_58 > > --- nlv13512/TestProgram ---> > > > > =3DAndries > > > > PS The attached patch was provided to me by Markus Mottl for the 3.09.1= . > > release. > > > > > > > > > > -----------------------------------------------------------------------= - > > Dr. Ir. Andries P. Hekstra > > Philips Research > > High Tech Campus 27 (WL-1-4.15) > > 5656 AG Eindhoven > > Tel./Fax/Secr. +31 40 27 42048/42566/44051 > > * Good open source anti-RSI software : http://www.workrave.org > > _______________________________________________ > > Caml-list mailing list. Subscription management: > > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > > Archives: http://caml.inria.fr > > Beginner's list: > > http://groups.yahoo.com/group/ocaml_beginners > > Bug reports: http://caml.inria.fr/bin/caml-bugs > > > > > > > > > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- >>>-- Nathaniel Gray -- Caltech Computer Science ------> >>>-- Mojave Project -- http://mojave.cs.caltech.edu -->