Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] CamlIDL question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chris Hecker <checker@d...>
Subject: Re: [Caml-list] CamlIDL question

>There is "ffcall" library
>that implements trampolines for (probably) all hardware platforms where
>OCaml may run. Am I using it with OcamlIDL to do just what Youry asked
>for.

I was planning on using the ffcall library to make dynalinking to C 
functions that take function pointers myself (you can see in the list 
archive a year or so ago).  I'm glad somebody's made it work.

However, the new bee in my bonnet is to have ocaml generate (or have it in 
the asm files for each platform) a sort of meta-routine that can be called 
at runtime to dynamically generate a range of different platform-specific 
functions that are necessary for this kind of lowlevel work.  You want some 
kind of routine that can generate a closure/thunk like ffcall, or switch 
the stack and cpu state like in the fiber/thread stuff, etc.  The idea is 
that since the ocaml runtime knows the platform (since it was compiled), it 
makes sense to have it do the work of generating the necessary low level 
code.  This would be way better than forcing every library that wants to do 
something cross-platform but low-level write asm or wacky C stuff or 
include ffcall or another redundant cross-platform low level library (like 
GNU pth, or whatever).  If we got the generator function(s) right, you 
could write a caml library that does wacky stuff and do it in a 
cross-platform way (and if the meta-function was right and well debugged 
you wouldn't have to exhaustively test your new library on every platform 
before releasing it...well, maybe that's a bit optimistic, but you get the 
idea).

The problem is to define the correct meta-function (or set of them), and 
I'm not sure what that would be yet, but I'm pretty sure it's possible.  I 
got the idea from the concept of the "fold" function (homomorphisms)...you 
can use fold to generate tons of other useful functions.  I want the fold 
for platform-specific low-level craziness.  :)

Enough rambling,
Chris


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners