Manuel | The FFI discussion seems to be completely stalled. Would | you, as our Tsar, like to summarise the state of play, and | re-invigorate it? There was a bit of discussion, which led, I think to a simplification of the library stuff. But we don't have a summary (even informal) of the current state of play, and that's beginning to be a problem here because we're about to implement the .NET FFI for GHC. Might I suggest http://research.microsoft.com/~simonpj/ffi.html as the basis for a state-of-play-summary. You can grab the source and modify it as you see fit. There's one particular issue we havn't discussed. For Java and .NET we want to call static methods, dynamic methods, and constructors. We already have foreign import static foreign import dynamic but 'new' is different again. The obvious place for it is in the language-specific string foreign import static "new foo(int x)" foo :: Int -> IO Foo It seems a bit odd to have static/dynamic *outside* but "new" inside the language-specific string. I suppose the justification is that 'new' is really a static method with a funny way to call it. Whereas the 'self' parameter on a dynamic call is treated specially. So that's ok, but we should agree that's what we want. Simon
Fri, 6 Apr 2001 09:04:32 -0700, Simon Peyton-Jones <simonpj@microsoft.com> pisze:
It seems a bit odd to have static/dynamic *outside* but "new" inside the language-specific string. I suppose the justification is that 'new' is really a static method with a funny way to call it. Whereas the 'self' parameter on a dynamic call is treated specially.
So that's ok, but we should agree that's what we want.
Seems OK for me in the case of importing. But what does foreign export mean in the context of Java or .NET? Can whole classes be created? How does static/dynamic/new fit there? In C functions are standalone, which is unlike Java. In the C case there is no foreign name in dynamic imports and exports. In Java there are: there is no distinguished function pointer type, we are going to treat all classes as kind of function pointers with multiple entry points. Looks ok? I'm not familiar with Java's native methods. Can both static and non-static methods be native? Can constructors be native? Shouldn't foreign export dynamic generate a function which creates instances of (an inner subclass of) some explicitly specified class? -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTÊPCZA QRCZAK
"Simon Peyton-Jones" <simonpj@microsoft.com> wrote,
Manuel
| The FFI discussion seems to be completely stalled. Would | you, as our Tsar, like to summarise the state of play, and | re-invigorate it?
There was a bit of discussion, which led, I think to a simplification of the library stuff. But we don't have a summary (even informal) of the current state of play, and that's beginning to be a problem here because we're about to implement the .NET FFI for GHC.
I am at this now. Starting with the foreign import/export declarations to summarise what we discussed.
There's one particular issue we havn't discussed. For Java and .NET we want to call static methods, dynamic methods, and constructors. We already have foreign import static foreign import dynamic
but 'new' is different again. The obvious place for it is in the language-specific string foreign import static "new foo(int x)" foo :: Int -> IO Foo
It seems a bit odd to have static/dynamic *outside* but "new" inside the language-specific string. I suppose the justification is that 'new' is really a static method with a funny way to call it. Whereas the 'self' parameter on a dynamic call is treated specially.
Basically, as you say, from the point of Haskell, `new' really is not that special, but there is a huge difference between `static' and `dynamic'. I think, this justifies pushing `new' into the language specific string. Cheers, Manuel
participants (3)
-
Manuel M. T. Chakravarty -
qrczak@knm.org.pl -
Simon Peyton-Jones