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 FAA02156; Wed, 28 Apr 2004 05:43:42 +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 FAA02147 for ; Wed, 28 Apr 2004 05:43:41 +0200 (MET DST) Received: from glockenspiel.complete.org (glockenspiel.complete.org [69.10.152.57]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i3S3hdYM005646 for ; Wed, 28 Apr 2004 05:43:40 +0200 Received: from localhost (localhost [127.0.0.1]) by glockenspiel.complete.org (Postfix) with ESMTP id EE7A52F1; Tue, 27 Apr 2004 22:43:43 -0500 (CDT) Received: from glockenspiel.complete.org ([127.0.0.1]) by localhost (glockenspiel [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 09570-05; Tue, 27 Apr 2004 22:43:43 -0500 (CDT) Received: from erwin.complete.org (unknown [12.149.180.20]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "erwin.complete.org", Issuer "John Goerzen -- Root CA" (verified OK)) by glockenspiel.complete.org (Postfix) with ESMTP id A274E2FA; Tue, 27 Apr 2004 22:43:41 -0500 (CDT) Received: from heinrich.complete.org (heinrich.lan.complete.org [10.200.0.15]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "christoph.complete.org", Issuer "John Goerzen -- Root CA" (verified OK)) by erwin.complete.org (Postfix) with ESMTP id E6DB3780; Tue, 27 Apr 2004 22:43:33 -0500 (CDT) Received: by heinrich.complete.org (Postfix, from userid 1000) id 0C159BFB; Tue, 27 Apr 2004 22:44:15 -0500 (CDT) Date: Tue, 27 Apr 2004 22:44:15 -0500 From: John Goerzen To: Benjamin Geer Cc: Yamagata Yoriyuki , warplayer@free.fr, caml-list@inria.fr Subject: Re: [Caml-list] Re: Common IO structure Message-ID: <20040428034415.GB19564@complete.org> References: <016401c42bc4$b6438840$19b0e152@warp> <20040428.004358.45522587.yoriyuki@mbg.ocn.ne.jp> <016501c42c73$24e64b30$ef01a8c0@warp> <20040428.015800.126758722.yoriyuki@mbg.ocn.ne.jp> <408EEE3E.7050008@socialtools.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <408EEE3E.7050008@socialtools.net> User-Agent: Mutt/1.5.5.1+cvs20040105i X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at complete.org 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 2004:99 nio:99 api:01 model:01 api:01 python:01 readline:01 extlib:01 abstractions:01 pervasives:01 buffer:01 unicode:01 unicode:01 sockets:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Apr 28, 2004 at 12:35:26AM +0100, Benjamin Geer wrote: > In Java there are two I/O libraries, the original one (java.io)[1] and > the new one (java.nio)[2]. The old one has the virtue of being easy to > understand and use, and flexible enough for many situations. The basic Uh, no. I don't have the API reference in front of me, but I seem to recall somewhere around a dozen or so predefined classes for doing I/O... all sorts of StreamReaders, etc, etc. Please do not model anything after this horribly bloated API. Python is simple. One standard for everything. You get read(), write(), readline(), readlines(), xreadlines() (hello Extlib, this one's for you), seek(), etc. This can apply to files, strings, sockets, pipes, whatever. Before we can start fussing about unicode abstractions, I think we need to have a uniform I/O layer. Already we have two competing ones (Pervasives vs. Unix) that don't exactly play along well, and we have no way to emulate a channel with a Buffer (which is a quite useful thing, one which I wish I had many times for OUnit test cases). Others have other I/O layers for sockets, etc. too. Once you have a standard base to use, it makes more sense to build Unicode or other logical readers atop that standard. But make it lean and flat; just tall and fat like Java. -- John ------------------- 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