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 QAA28576; Mon, 26 Apr 2004 16:56:56 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA28648 for ; Mon, 26 Apr 2004 16:56:55 +0200 (MET DST) Received: from smtp.mbg.ocn.ne.jp (mbg.ocn.ne.jp [210.190.142.181]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3QEurjq019291 for ; Mon, 26 Apr 2004 16:56:54 +0200 Received: from localhost (p21109-adsau12honb7-acca.tokyo.ocn.ne.jp [220.99.25.109]) by smtp.mbg.ocn.ne.jp (Postfix) with ESMTP id 7FD666531; Mon, 26 Apr 2004 23:56:52 +0900 (JST) Date: Mon, 26 Apr 2004 23:53:57 +0900 (JST) Message-Id: <20040426.235357.104032543.yoriyuki@mbg.ocn.ne.jp> To: info@gerd-stolpmann.de Cc: caml-list@inria.fr Subject: [Caml-list] Re: Common IO structure From: Yamagata Yoriyuki In-Reply-To: <1082894040.8846.196.camel@ice.gerd-stolpmann.de> References: <007501c429de$7aee90b0$19b0e152@warp> <20040425.175623.71081314.yoriyuki@mbg.ocn.ne.jp> <1082894040.8846.196.camel@ice.gerd-stolpmann.de> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; yamagata:01 yoriyuki:01 yoriyuki:01 gerd:01 stolpmann:01 caml-list:01 2004:99 atoms:01 ocamlnet:01 atoms:01 camomile:01 char:01 uchar:01 ocamlnet:01 camomile:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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.) 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. -- Yamagata Yoriyuki ------------------- 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