Hi, I´m Carol, and I´m just need some help to find the predefined types from the storable class. I´ll be thankfull if you could answer.
Carolina Mattos Cavalcanti wrote:
I´m Carol, and I´m just need some help to find the predefined types from the storable class. [...]
The following types are instances of Storable: Bool, Char, Int, Word, Ptr a, FunPtr a, StablePtr a, Float, Double, Word8, Word 16, Word32, Word64, Int8, Int16, Int32, Int64, Addr Note that the FFI "looks through" newtypes, so e.g. everything from CTypes is an instance of Storable, too. Did you have a look at the FFI draft http://www.cse.unsw.edu.au/~chak/haskell/ffi.ps.gz especially sec. 5.7? If yes, we should clarify this a bit... Hope that helps, S.
On Fri, 4 Jan 2002, Sven Panne wrote:
Did you have a look at the FFI draft http://www.cse.unsw.edu.au/~chak/haskell/ffi.ps.gz
I just read this paper. It seems to focus on local interfaces rather than on interfaces that will also work accross network connections. A modern FFI interface should offer both transparent object serialization (like Java, but readable) and interfaces that work between programs running on different machines (RPC). MIME provides the infrastructure required for doing so. It defines both a serialization format and a public type system that individual languages may support in different ways. MIME is already in use in millions of web applications and web browsers. I've tried to document its use as an FFI at MIME-RPC.com (and created a discussion group for MIME-RPC related issues at http://groups.yahoo.com/group/mime-rpc). I had been thinking of it as a system for inter-process messaging (as well as object serialization), and created an implementation in Python for doing so. However, there are no Haskell or C implementations yet. I would welcome thoughts from people here on how to do both efficiently and how to use such implementations for in-process communication as well as network communication. -Alex- PS Dave Winer's Scripting.com just picked up MIME-RPC so I think the idea is gaining some traction. ___________________________________________________________________ S. Alexander Jacobson i2x Media 1-212-787-1814 voice 1-603-288-1280 fax
S. Alexander Jacobson wrote:
[...] It seems to focus on local interfaces rather than on
interfaces that will also work accross network connections.
A modern FFI interface should offer both transparent object
serialization (like Java, but readable) and interfaces that
work between programs running on different machines (RPC).
Granted, but our design is minimalistic and *much* less ambitious: It should be relatively easy to implement (otherwise it probably won't get implemented at all :-} and should only provide the things which otherwise can't be expressed in pure Haskell. Higher-level and convenience stuff, even such "easy" things as provided in the Marshal* modules, are a library issue in our view. Interfacing to non-local interfaces is beyond the scope of the FFI draft, mainly because there is not "the" way to do it. Some day the draft hopefully finds its way into the H98 report as an addendum, and this is definitely not the right place for experimental stuff. It was quite hard to find consensus even on such simple things as the syntax for external entities (anybody remembers "Wadler's law of language design"? :-), the typing of plusPtr, the handling of newtypes, etc.
[...] I've tried to document its use as an FFI at MIME-RPC.com
(and created a discussion group for MIME-RPC related issues at http://groups.yahoo.com/group/mime-rpc).
I'll surely have a look at this.
[...] However, there are no Haskell or C implementations yet. [...]
The current FFI stuff is very probably a basis for implementing your stuff in Haskell as a library. Even if it's not, it would be interesting to hear what is missing. A rudimentary implementation is probably the best starting point for a discussion, some "real" programs using it would be even better. Cheers, S.
participants (3)
-
Carolina Mattos Cavalcanti -
S. Alexander Jacobson -
Sven Panne