Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] [ANN] The Missing Library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-04-28 (03:43)
From: John Goerzen <jgoerzen@c...>
Subject: Re: [Caml-list] Re: Common IO structure
On Wed, Apr 28, 2004 at 12:35:26AM +0100, Benjamin Geer wrote:
> In Java there are two I/O libraries, the original one ([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 Archives:
Bug reports: FAQ:
Beginner's list: