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.2 required=5.0 tests=AWL,MAILTO_TO_SPAM_ADDR autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 2C107BC69 for ; Sun, 15 Jul 2007 19:50:17 +0200 (CEST) Received: from smtp6-g19.free.fr (smtp6-g19.free.fr [212.27.42.36]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6FHoGR9004152 for ; Sun, 15 Jul 2007 19:50:17 +0200 Received: from Tocksi.local (lns-bzn-21-82-64-127-12.adsl.proxad.net [82.64.127.12]) by smtp6-g19.free.fr (Postfix) with ESMTP id 878E3B7E23; Sun, 15 Jul 2007 19:50:16 +0200 (CEST) Message-ID: <469A5E51.4080200@univ-savoie.fr> Date: Sun, 15 Jul 2007 19:50:09 +0200 From: Christophe Raffalli User-Agent: Thunderbird 2.0.0.4 (Macintosh/20070604) MIME-Version: 1.0 To: Basile STARYNKEVITCH , caml-list@yquem.inria.fr Subject: Re: unboxed scalars - was [Caml-list] caml: camlp4 revised syntax References: <4699FB8A.2020504@menta.net> <469A082A.70303@starynkevitch.net> In-Reply-To: <469A082A.70303@starynkevitch.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Miltered: at discorde with ID 469A5E58.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; christophe:01 raffalli:01 christophe:01 raffalli:01 univ-savoie:01 unboxed:01 camlp:01 syntax:01 basile:01 compiler:01 unboxed:01 compilation:01 polymorphic:01 polymorphic:01 wrote:01 Basile STARYNKEVITCH a écrit : > tmp123@menta.net wrote: >> Hello, >> >> First of all, thanks to all people who develops this language and >> related tools, and to people who supports them using it. >> >> I decided to use it in several developments. When finished, the >> developed modules will be made public, if they are enough generic >> (best place to publish it?) >> >> Two points still causing some troubles: >> >> 1) The internal integer coding: >> >> It seems that an integer of value "x" is internally stored like >> "2x*1" ( x shift 1 or 1 ). That is a loss of performance, not only >> when doing calculations, but also, by example, when using the integer >> as index of a string character, ... . Usage of native-int doesn't >> improves the subject. > > This is unlikely to change any soon. It is (nearly) required by > polymorphic functions (like List.map). > > Changing it would require a very major change of the compiler, which > should specialize all polymorphic functions for such unboxed scalar > types. If it was done, it would require either a whole program > compilation, or a possible (exponential) bloat of generated code size > (basically for each polymorphic function, you would have to generate > all the scalar forms in addition of the polymorphic one). > Just look at MLTon, everything is monomorphised (and defunctorized) before generating assembly code ... and it works, because polymorphic functions are used in fact with a very small set of types (often one !) and only small function like map are used with many type ... So MLTon way may be the future of ML Christophe