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] 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: 2005-10-29 (11:36)
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

> 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?


> 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.


> Kindest Regards,
> Jonathan
> _______________________________________________
> Caml-list mailing list. Subscription management:
> Archives:
> Beginner's list:
> Bug reports:
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany
Telefon: 06151/153855                  Telefax: 06151/997714