Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Changing implementations of standard libraries...
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Gerd Stolpmann <info@g...>
Subject: Re: [Caml-list] Changing implementations of standard libraries...
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
------------------------------------------------------------