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: -- (:)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: [Caml-list] Changing implementations of standard libraries...

What changes does -vmthread make to the compiler when generating code?
I see vmthreads provides it's own version of pervasives for starters.

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?

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.

Kindest Regards,