From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id BAA03485; Mon, 14 Oct 2002 01:22:12 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA03959 for ; Mon, 14 Oct 2002 01:22:11 +0200 (MET DST) Received: from relay.pair.com (relay1.pair.com [209.68.1.20]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id g9DNMA506417 for ; Mon, 14 Oct 2002 01:22:10 +0200 (MET DST) Received: (qmail 67593 invoked from network); 13 Oct 2002 23:22:08 -0000 Received: from node-d8e9cca2-sfo-onnet.worldcom.com (HELO checkerlap.d6.com) (216.233.204.162) by relay1.pair.com with SMTP; 13 Oct 2002 23:22:08 -0000 X-pair-Authenticated: 216.233.204.162 Message-Id: <4.3.2.7.2.20021013154133.032e9ba0@mail.d6.com> X-Sender: checker@mail.d6.com X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Sun, 13 Oct 2002 16:12:35 -0700 To: Dmitry Bely , caml-list@inria.fr From: Chris Hecker Subject: Re: [Caml-list] CamlIDL question In-Reply-To: References: <20021013104825.H13771@pauillac.inria.fr> <20021007140248.GA22632@rashko.ilt.kharkov.ua> <20021013104825.H13771@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >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