From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 5FDB1BB81 for ; Wed, 8 Dec 2004 17:16:23 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iB8GGNkI003656 for ; Wed, 8 Dec 2004 17:16:23 +0100 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 RAA15568 for ; Wed, 8 Dec 2004 17:16:22 +0100 (MET) Received: from yquem.inria.fr (yquem.inria.fr [128.93.8.37]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iB8GFpUS003577; Wed, 8 Dec 2004 17:15:52 +0100 Received: by yquem.inria.fr (Postfix, from userid 18180) id E1CB8BB81; Wed, 8 Dec 2004 17:15:51 +0100 (CET) Date: Wed, 8 Dec 2004 17:15:51 +0100 From: Xavier Leroy To: Richard Jones Cc: caml-list@inria.fr Subject: Re: [Caml-list] Line buffering Message-ID: <20041208161551.GA1689@yquem.inria.fr> References: <20041207135745.GA31131@annexia.org> <200412071810.iB7IA0Ec001558@waco.inria.fr> <20041207181711.GA21906@annexia.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041207181711.GA21906@annexia.org> User-Agent: Mutt/1.3.28i X-Miltered: at concorde with ID 41B728D7.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41B728B7.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 buffering:01 ocaml:01 buffering:01 malloc:01 wrote:01 threads:01 non-blocking:01 threads:01 functions:01 caml:02 guess:02 seems:03 library:03 inria:05 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: > I noticed before that OCaml seems to implement its own I/O buffering > system, instead of using FILE* (or sfio, I guess). Is there a reason > for that? Largely historical. Early versions of Caml Light, circa 1990, had a GC which did not play nice with "malloc", hence many standard C library functions such as fopen() could not be used. The buffering code that I wrote at that time managed to survive until now. Also, bytecode-level threads (vmthreads) need to do non-blocking I/O on I/O channels, and I don't think this could be done reliably with FILE*. This said, one could also argue that bytecode-level threads are another survivance of the past. - Xavier Leroy