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 autolearn=disabled version=3.1.3 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 37EDBBC69 for ; Tue, 13 Nov 2007 09:53:31 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAALv0OEfAXQImh2dsb2JhbACPCAEBAQgKKYEP X-IronPort-AV: E=Sophos;i="4.21,409,1188770400"; d="scan'208";a="5730142" Received: from discorde.inria.fr ([192.93.2.38]) by mail3-smtp-sop.national.inria.fr with ESMTP; 13 Nov 2007 09:53:30 +0100 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id lAD8rUNp006209 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 13 Nov 2007 09:53:30 +0100 From: pierre.weis@inria.fr (Pierre Weis) X-IronPort-AV: E=Sophos;i="4.21,409,1188770400"; d="scan'208";a="5730140" Received: from yquem.inria.fr ([128.93.8.37]) by mail3-relais-sop.national.inria.fr with ESMTP; 13 Nov 2007 09:53:30 +0100 Received: by yquem.inria.fr (Postfix, from userid 24253) id 075B4BC69; Tue, 13 Nov 2007 09:53:30 +0100 (CET) Date: Tue, 13 Nov 2007 09:53:30 +0100 To: =?iso-8859-1?Q?B=FCnzli?= Daniel Cc: caml-list List Subject: Re: [Caml-list] OCaml's formatting libraries Message-ID: <20071113085329.GA20423@yquem.inria.fr> References: <9d3ec8300711080617g1b023711o1a8f9aa50b7874@mail.gmail.com> <47334DAA.80407@inria.fr> <1194548803.47335e4348ebb@webmail.in-berlin.de> <20071109180948.GA15291@yquem.inria.fr> <92C50802-AFEE-4CD4-9F47-FBC9BCABC7A1@erratique.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <92C50802-AFEE-4CD4-9F47-FBC9BCABC7A1@erratique.ch> User-Agent: Mutt/1.5.9i X-Miltered: at discorde with ID 4739660A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; weis:01 weis:01 ocaml's:01 caml's:01 danvy's:01 unparsing:01 scanf:01 doable:01 unparsing:01 printf:01 scanf:01 users':01 algebra:01 bug:01 bug:01 [...] > A question I have is why caml's formatting libraries were not > deprecated in favor of an implementation using Danvy's functional > unparsing [1]. This approach doesn't require an extension to the type > system and if I read correctly these results [2] it seems at least as > efficient as the current implementation. Scanf seems also doable [3]. If this functional unparsing can be rendered fully backward compatible with the existing printf and scanf related Caml users' code base, then we can give it a try. Otherwise, we would have to maintain two libraries in parallel... > The less complexity there is in the type system the safer we are in > the end. The type system is not modified. We just have to add a new basic (polymorphic) type constant to the set of basic types; and the corresponding constant values are then type checked using the plain old polymorphic type algebra. The problem we have with the dynamic format strings compatibility check is similar to any other bug into any other basic Caml primitive: a bug in those primitives can be fatal to the type safety. (The bug in the compatibility check has similar consequences as would a bug in the implementation of the int_of_string primitive, if int_of_string were erroneously returning a float value in some rare cases, while still keeping the regular string -> int type scheme.) All the best, -- Pierre Weis INRIA Rocquencourt, http://bat8.inria.fr/~weis/