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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 19A5BBBAF for ; Sat, 7 Nov 2009 02:56:33 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEALti9EqCNhAB/2dsb2JhbADcIIQ+BIJe X-IronPort-AV: E=Sophos;i="4.44,697,1249250400"; d="scan'208";a="37688106" Received: from kurims.kurims.kyoto-u.ac.jp ([130.54.16.1]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 07 Nov 2009 02:56:31 +0100 Received: from localhost (orion [130.54.16.5]) by kurims.kurims.kyoto-u.ac.jp (8.13.8/8.13.8) with ESMTP id nA71uL1t017824; Sat, 7 Nov 2009 10:56:21 +0900 (JST) Date: Sat, 07 Nov 2009 10:56:20 +0900 (JST) Message-Id: <20091107.105620.219613657.garrigue@math.nagoya-u.ac.jp> To: kybic@fel.cvut.cz Cc: caml-list@inria.fr Subject: Re: [Caml-list] Re: ATS versus Ocaml From: Jacques Garrigue In-Reply-To: <87ljijd5os.fsf@fel.cvut.cz> References: <87fx8reuvr.fsf_-_@fel.cvut.cz> <87ljijd5os.fsf@fel.cvut.cz> X-Mailer: Mew version 6.2.51 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocaml:01 ocaml:01 -unsafe:01 runtime:01 annotations:01 syntax:01 runtime:01 ocaml's:01 -unsafe:01 compile:01 caml-list:01 bounds:02 checking:02 checking:02 garrigue:03 From: Jan Kybic >>Do you know if ATS is performing array bound checking? The OCaml code is >>nearly 2X faster with -unsafe than without. > > Yes, I think the ATS code does perform bound checking. There is > probably a way to avoid it but I do not know how to do it yet. The whole point of ATS is to use a richer type system to avoid many runtime checks. Static check of bounds is supposedly one of them. If your program is written with the clever .. annotations (I don't remember the exact syntax), then there should be no bound checks at runtime. Not that this is not equivalent to ocaml's -unsafe: the program is still safe, since the checks were done at compile time. Jacques Garrigue