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 D9FAEBB81 for ; Tue, 21 Mar 2006 17:23:43 +0100 (CET) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.197]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k2LGNf2i031921 for ; Tue, 21 Mar 2006 17:23:43 +0100 Received: by wproxy.gmail.com with SMTP id i34so1417459wra for ; Tue, 21 Mar 2006 08:23:41 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EMFe+oQY0qh6A7YIsd3o23sGwzjyryLdKYU0dfhPhoALQ+2D+Q01nToPj7IZNqL7y3QNM8H5IRTmP5qRA9fm3jjOdaRQJFb6pMg9EnLCp+gvz9A2Md6wKLsUfgJfVzWtv+EFKsFx5/6BG4hY7AJIwPjKAPkWUleczdj3E1wLwbk= Received: by 10.64.91.16 with SMTP id o16mr782244qbb; Tue, 21 Mar 2006 08:23:36 -0800 (PST) Received: by 10.65.51.11 with HTTP; Tue, 21 Mar 2006 08:23:36 -0800 (PST) Message-ID: <2a1a1a0c0603210823k6833a073k753bffe306b2430c@mail.gmail.com> Date: Tue, 21 Mar 2006 11:23:36 -0500 From: "Mike Lin" Sender: nilekim@gmail.com To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Another great advantage for OCaml language due to Markus Mottl In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Miltered: at nez-perce with ID 4420288D.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; mikelin:01 ocaml:01 markus:01 mottl: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 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 ago > (array index violation after around 4 days) has in the mean time been sol= ved > thanks to the great native function call backtrace for the ocamlopt compi= ler > 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 was > not an option (this slowdown had been similar if I had used _DEBUG mode o= f a > C++ program instead of _RELEASE version). Also, as reported earlier, putt= ing > "try ... with " around all attempts to index an array is not feasbile in > standard OCaml for array elements in the left hand sides of assignments. = A > static unhandled exception checker provided on a web page, ran into dead > HTML links. > > Hence, the native function call, which comes at minimal runtime overhead > cost, mainly the cost of -inline 0, is a great new feature that would giv= e > OCaml another advantage over C++ when added to the OCaml language in a ne= xt > 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 > > > >