From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA21443; Mon, 26 Apr 2004 23:02:50 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA21170 for ; Mon, 26 Apr 2004 23:02:49 +0200 (MET DST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.189]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i3QL2mYM018288 for ; Mon, 26 Apr 2004 23:02:48 +0200 Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1BIDFY-0004TU-00; Mon, 26 Apr 2004 23:02:48 +0200 Received: from [80.129.114.89] (helo=gate.gerd-stolpmann.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1BIDFX-0006PG-00; Mon, 26 Apr 2004 23:02:48 +0200 Received: from ice.gerd-stolpmann.de (ice.gerd-stolpmann.de [192.168.0.13]) by gate.gerd-stolpmann.de (Postfix) with ESMTP id 7D14A5816; Mon, 26 Apr 2004 23:02:47 +0200 (CEST) Received: by ice.gerd-stolpmann.de (Postfix, from userid 1000) id 33562B032; Mon, 26 Apr 2004 23:02:47 +0200 (CEST) Subject: [Caml-list] Re: Common IO structure From: Gerd Stolpmann To: Yamagata Yoriyuki Cc: caml-list@inria.fr In-Reply-To: <20040426.235357.104032543.yoriyuki@mbg.ocn.ne.jp> References: <007501c429de$7aee90b0$19b0e152@warp> <20040425.175623.71081314.yoriyuki@mbg.ocn.ne.jp> <1082894040.8846.196.camel@ice.gerd-stolpmann.de> <20040426.235357.104032543.yoriyuki@mbg.ocn.ne.jp> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1083013365.8849.333.camel@ice.gerd-stolpmann.de> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Mon, 26 Apr 2004 23:02:47 +0200 X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:a6865a839c0178d9aa0ce41878507ea2 X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; gerd:01 stolpmann:01 2004:99 yamagata:01 yoriyuki:01 gerd:01 stolpmann:01 caml-list:01 2004:99 atoms:01 ocamlnet:01 atoms:01 camomile:01 char:01 uchar:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, 2004-04-26 at 16:53, Yamagata Yoriyuki wrote: > From: Gerd Stolpmann > Subject: Re: Common IO structure (was Re: [Caml-list] [ANN] The Missing Library) > Date: Sun, 25 Apr 2004 13:54:01 +0200 > > > They differ, however, in > > what they see as their atoms, i.e. smallest entities read from and > > written to a channel, for ocamlnet atoms are strings, for camomile atoms > > are characters (char or UChar.t), reflecting a different view what the > > libraries regard as important features. > > > > I could imagine ocamlnet and camomile share the same signatures if > > camomile would use some kind of polymorphic strings instead. > > String-based I/O is much faster than character-based I/O, so camomile > > would even profit from this change. However, this unification requires > > that we define the algebraic properties of strings and string buffers, > > which is not as easy as it sounds. > > When I did a compatison, the speed of Camomile code converter is in > the same order of iconv (EUC-JP -> UTF8 2-times slower, UTF8 -> EUC-JP > 50% faster). I doubt that char-based I/O is significantly slower, > unless operation is very simple. String-based I/O has to manage > buffer strings, which causes extra cost, and anyways the major cost > comes from elsewhere. (For code converters, the major cost is caused > by table lookup.) I really believe this, when you are doing charset conversions. Note that ocamlnet's channels are used for other things, too, e.g. email parsing, and char-by-char operation is simply inacceptable for that. So I fear one cannot generally say that char-by-char I/O is the common case. > That said, I plan to add string-based I/O for character channels, > partially to interpolate C fucitons. So, for character channels, > Camomile would be compatible ocamlnet. Good news. Gerd -- ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de ------------------------------------------------------------ ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners