From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id CA22EBC69 for ; Fri, 30 Mar 2007 11:01:24 +0200 (CEST) Received: from triton.rz.uni-saarland.de (triton.rz.uni-saarland.de [134.96.7.25]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2U91O5N028124 for ; Fri, 30 Mar 2007 11:01:24 +0200 Received: from mail.cs.uni-sb.de (mail.cs.uni-sb.de [134.96.254.200]) by triton.rz.uni-saarland.de (8.12.11.20060614/8.12.10) with ESMTP id l2U90S1i6591276; Fri, 30 Mar 2007 11:00:28 +0200 (CEST) Received: from mail.ps.uni-sb.de (james.ps.uni-sb.de [134.96.186.68]) by mail.cs.uni-sb.de (8.14.0/2007012900) with ESMTP id l2U90RWA016125; Fri, 30 Mar 2007 11:00:27 +0200 (CEST) Received: from groove.ps.uni-sb.de ([134.96.186.112]) by mail.ps.uni-sb.de with esmtp (Exim 4.50) id 1HXCy8-0004xN-Po; Fri, 30 Mar 2007 11:00:27 +0200 Message-ID: <460CD180.6080404@ps.uni-sb.de> Date: Fri, 30 Mar 2007 10:59:44 +0200 From: Andreas Rossberg User-Agent: Thunderbird 1.5.0.5 (X11/20060812) MIME-Version: 1.0 To: skaller Cc: Florian Weimer , Oliver Bandel , Yaron Minsky , caml-list@inria.fr References: <891bd3390703290927o4e1c6bb5gf8f562fedbc70096@mail.gmail.com> <20070329212931.GG6843@first.in-berlin.de> <891bd3390703291726ue71cfa6re8d4c3d66520e4d9@mail.gmail.com> <878xdfmbm8.fsf@mid.deneb.enyo.de> <1175244271.22118.10.camel@rosella.wigram> In-Reply-To: <1175244271.22118.10.camel@rosella.wigram> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 134.96.186.112 X-SA-Exim-Mail-From: rossberg@ps.uni-sb.de Subject: Re: [Caml-list] int_of_string bug X-SA-Exim-Version: 4.2 (built Thu, 03 Mar 2005 10:44:12 +0100) X-SA-Exim-Scanned: Yes (on mail.ps.uni-sb.de) X-AntiVirus: checked by AntiVir Milter (version: 1.1.3-1; AVE: 7.3.1.46; VDF: 6.38.0.146; host: AntiVir1) X-Miltered: at concorde with ID 460CD1E4.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; rossberg:01 rossberg:01 bug:01 ocaml:01 integers:01 non-issue:01 wrote:01 integer:01 exception:01 caml-list:01 ints:01 andreas:01 andreas:01 short:01 int:01 skaller wrote: >> >>> That's a problem too, but there is at least a defensible reason for >>> that, which is that it is expensive to get integer overflow to throw >>> an exception. >> i386 and amd64 have hardware support for that, so it's not very >> expensive. There are pretty short RISC sequences for the checks, too. >> >> MLton uses the i386 hardware support, and I think you can disable the >> checks, so measuring the overhead shouldn't be too hard. > > But there is a difference you may have missed: Ocaml integers > are 31 or 63 bits, not 32 or 64 bits. But it uses the most significant 31/63 bits for ints, so that becomes a non-issue. ;-) -- Andreas Rossberg, rossberg@ps.uni-sb.de