From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id B6009BB9A for ; Sat, 29 Oct 2005 13:36:42 +0200 (CEST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.190]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j9TBagRW028612 for ; Sat, 29 Oct 2005 13:36:42 +0200 Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1EVp0r-0002nm-00; Sat, 29 Oct 2005 13:36:41 +0200 Received: from [84.58.128.165] (helo=gate.lan.gerd-stolpmann.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1EVp0r-0005AN-00; Sat, 29 Oct 2005 13:36:41 +0200 Received: from flakew.lan.gerd-stolpmann.de (flakew.lan.gerd-stolpmann.de [192.168.0.32]) by gate.lan.gerd-stolpmann.de (Postfix) with ESMTP id 01EA2C053; Sat, 29 Oct 2005 13:36:41 +0200 (CEST) Subject: Re: [Caml-list] Changing implementations of standard libraries... From: Gerd Stolpmann To: Jonathan Roewen Cc: caml-list@yquem.inria.fr In-Reply-To: References: Content-Type: text/plain Date: Sat, 29 Oct 2005 13:36:40 +0200 Message-Id: <1130585800.15589.131.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:a6865a839c0178d9aa0ce41878507ea2 X-Miltered: at nez-perce with ID 43635ECA.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 gerd:01 stolpmann:01 compiler:01 afaik:01 pervasives:01 stdlib:01 cmi:01 o'caml:01 binary:01 stdlib:01 cmi:01 pervasives:01 stdin:01 ocaml:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 Am Samstag, den 29.10.2005, 16:47 +1300 schrieb Jonathan Roewen: > Hi, > > What changes does -vmthread make to the compiler when generating code? AFAIK, the generated code is the same. > I see vmthreads provides it's own version of pervasives for starters. A different version of the stdlib is linked. > Also, as long as the .cmi files don't change, one would be free to > replace the implementation with any thing they see fit, correct? Yes. But you cannot implement in O'Caml when the function is external because this is part of the interface, at least if you need binary compatibility. > For example, for my OS project, I would probably want to change the > implementation for the stdlib such that in_channel & out_channel would > be implemented on top of my OCaml-based VFS layer, rather than relying > on C code. I would assume, for example, that since in_channel is > considered abstract in the .cmi file, I could change the actual > implementation of the type to a custom record type -- is that correct? Yes. > Another example would be modifying vmthreads package to work inside an > OCaml-based process. This would then extend to pervasives and > stdin/out/err, so that they work correctly (from the ocaml process > data structure's file handles, rather than some global C variables). > > Apart from Unix module, which I'd like to do away with, the rest of > stdlib seems to be quite useful, just not compatible in the current > implementation for building a kernel without requiring doing lots of > stuff in C. > > I'm just not sure what to do with things like select(), and whether I > could implement some sort of replacement in ocaml, but that's a > separate issue entirely. I suppose select is quite hard for an OS implementor. Gerd > > Kindest Regards, > > Jonathan > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Telefon: 06151/153855 Telefax: 06151/997714 ------------------------------------------------------------