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 SAA02389; Tue, 27 Apr 2004 18:58:48 +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 SAA02518 for ; Tue, 27 Apr 2004 18:58:47 +0200 (MET DST) Received: from smtp.mbg.ocn.ne.jp (mbg.ocn.ne.jp [210.190.142.181]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i3RGwjYM021365 for ; Tue, 27 Apr 2004 18:58:46 +0200 Received: from localhost (p11121-adsau14honb7-acca.tokyo.ocn.ne.jp [220.106.67.121]) by smtp.mbg.ocn.ne.jp (Postfix) with ESMTP id A2AC5528F; Wed, 28 Apr 2004 01:58:44 +0900 (JST) Date: Wed, 28 Apr 2004 01:58:00 +0900 (JST) Message-Id: <20040428.015800.126758722.yoriyuki@mbg.ocn.ne.jp> To: warplayer@free.fr Cc: caml-list@inria.fr Subject: Re: [Caml-list] Re: Common IO structure From: Yamagata Yoriyuki In-Reply-To: <016501c42c73$24e64b30$ef01a8c0@warp> References: <016401c42bc4$b6438840$19b0e152@warp> <20040428.004358.45522587.yoriyuki@mbg.ocn.ne.jp> <016501c42c73$24e64b30$ef01a8c0@warp> 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 concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 yamagata:01 yoriyuki:01 yoriyuki:01 cannasse:01 warplayer:01 caml-list:01 2004:99 char:01 char:01 atoms:01 chunks:01 buffer:01 buffer:01 ocamlnet:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: "Nicolas Cannasse" Subject: Re: [Caml-list] Re: Common IO structure Date: Tue, 27 Apr 2004 18:17:32 +0200 > As someone told, read/write concepts are used in most of other languages > (including Java, C, and many others). read/write of Unix are block-wise operations. They are not suited for names for element-wise operations. get/put come from get_char/put_char of C. Maybe would get_element/put_element be better? > They'll maybe not - in the Unicode case, but they'll definilty help for > other IO. Unicode IO is one of most important IO, second of character IO. (Maybe most important in the future.) And I doubt the benefit of bufferd IO, as I stated in the previous mail. Unless operation is very simple, and atoms are very small, (that is, character IO) extra cost of element-wise IO is not important. Note that channels can internally process data by chunks. Only difference is that copy between the internal buffer and an external buffer occurs in bulk. or element-wise. I'm interested in an emprical evidence, though. > If the user need to write both chars and strings, he will need to > carry two objects instead of one. No. The guy will use a single object having a signature like this. object method get : char method input : string -> int -> int -> int method close_in : unit end It confirms both of class type I proposed for input. > class input = object > method read : char > method nread : int -> string > method close_in : unit > end > > class output = object > method write : char > method nwrite : string > method close_out : unit > end The types of nread and nwrite differ substantially from input/output in ocamlnet, which means major rewrite of ocamlnet. And I am not sure that allocating a new string for each input offers the performance benefit. I'm interested in (potential) users of IO libraries. Could someone comment on IO system of Jave, Perl, Python, for example? -- 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