English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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-27 (18:51)
From: Yamagata Yoriyuki <yoriyuki@m...>
Subject: Re: [Caml-list] Re: Common IO structure
From: "Nicolas Cannasse" <warplayer@free.fr>
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

> 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

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.

 method	get : char
 method input : string -> int -> int -> int
 method close_in : unit

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

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