From: Brian H. <bh...@sp...> - 2004-04-09 16:27:11
|
On Fri, 9 Apr 2004, Nicolas Cannasse wrote: > The problem is also the cost of reimplemeting. > It was little painful for me to have to use the zlib, since I know it will > requires all my sub-projects to compile and deploy some C code : the zlib > itself - but also the CamlZip stubs (for which an Win32 Makefile was not > given). But after looking at the ZLib format RFC, I somehow thought that it > would take me quite a lot of time to reimplement it, and in the end maybe > get a lower quality result (since zlib itself is quite a nice piece of code, > highly suppported and optimized). Hmm. Poking at a little bit, it doesn't look that bad. Actually, Ocaml might be a better language to implement them in, as several of the core data structures are already implemented. > > If I had enough time, this is what I will do : [ write EmuC ] The performance I'm not worried about- I don't think it'd be that bad. Nor the writting of stubs. EmuC would just be a library that shouldn't be used except by knowledgable people. Rather like the tricks we do in the optimized List module. We're already saying "do as we say, not as we do." This is one of the purposes of libraries, IMHO- the library gets the tricky stuff right, and everyone else uses the library. No, the problems I have with this idea are: 1) You'd still have C dependencies, breaking the Ocaml-only nature of ExtLib. 2) You would still have to deal with impedence mismatches- C API's that don't translate well into Ocaml. For example, routines which take pointers to variables to return more than one value. Or APIs that depend upon the "shape" of variables (for example, using unions). Or that want to use Macros to inline code. I'm not sure what all the impedence problems might be. -- "Usenet is like a herd of performing elephants with diarrhea -- massive, difficult to redirect, awe-inspiring, entertaining, and a source of mind-boggling amounts of excrement when you least expect it." - Gene Spafford Brian |