From: Bardur A. <lis...@sc...> - 2005-02-28 19:53:11
|
(CC'd to the mailing list, I hope you don't mind) On Mon, Feb 28, 2005 at 09:27:03PM +0200, Janne Hellsten wrote: > Comments on the module: > 1. When you call Unix.write, you don't do any error translation into > ExtLib IO exceptions. I never use ExtLib's IO, but shouldn't the > O'Camls Unix errors be converted into something more ExtLib? IMHO, any translation will just obscure real problems -- and to be able to give the caller enough exception information, any "new" exceptions would be almost identical to the Unix ones. Better to have a shallow interface, IMHO. Besides, the caller *knows* that Unix.{write,read,...} will be used, so they should know which exceptions can be raised from those. > What if "Unix.write" returns something else than the number of bytes in > the buffer? You just silently ignore that. Unix.write *will* actually always write the number of bytes given to it (see the doc) unless the is an error. If any error occurs, an exception is raised by the Unix module. So this is a non-issue. > 2. I guess you know already, but perhaps you meant extUnix and not > extunix for the filenames? I'm not sure I follow... are you talking about the attachments? In my MUA the names are shown as "extUnix.ml" and "extUnit.mli". > 3. How about the Makefiles then? I gather this would need additional > libraries in order to be able to link this separately from the rest of > ExtLib. Hmm... I *think* this is all taken care of by the linker; it shouldn't link in Unix unless functions which require it are called from the program being linked. (Otherwise, using one ExtLib module would seem to imply that the code for all of them is automatically included... which I hope isn't the case). AFAIK the Unix module is available on all platforms, so from an avaiability perspective it shouldn't be an issue. > I anticipate that ExtUnix module would also some day need C files as > well, since it's pretty low-level stuff. I wonder if the rule against > C files should be relaxed w.r.t this module? My opinion is that ExtLib should be limited to pure OCaml code, but this is mostly from a practical perspective... supporting C code on lots of platforms (different versions of different OS'es, architectures, etc.) can be extremely time-consuming... add to this the fact that the semantics of system calls may differ subtly between platforms and you have a recipe for disaster, IMHO. Cheers, -- Bardur Arantsson <ba...@im...> <ba...@sc...> - Good... Bad... I'm the guy with the gun. Ash | Army of Darkness |