Custom calling conventions

Manu turkeyman at gmail.com
Tue Feb 21 12:55:42 PST 2012


On 21 February 2012 22:33, H. S. Teoh <hsteoh at quickfur.ath.cx> wrote:

> On Tue, Feb 21, 2012 at 08:01:11PM +0000, Iain Buclaw wrote:
> > On 21 February 2012 17:10, Manu <turkeyman at gmail.com> wrote:
> [...]
> > > With the (typically VM based) languages I was referring to, there's
> > > no direct linkage, all communication must be via some API, so the
> > > intrinsic knowledge of foreign structures is not necessary in that
> > > case. You would always need to understand the layout or contents of
> > > foreign structures via some sort of marshalling api/class, since the
> > > VM is free to do whatever it likes internally.
>
> Doesn't JNI define the standards as to how things are laid out?
>
>
> > You will need to know where things are with Java Classes, so I would
> > have thought that would be a very problematical issue for you...
> > Although D (gdc) follows a similiar but not identical ABI to Java
> > (vtable should be located in the same area).
> [...]
>
> Can Java data structures even be mapped to D types at all? Don't you
> already have to marshall/translate data structures anyway?


I'm talking about a function calling system, not understanding foreign data
types. I think that's way beyond the scope of 'extern(x) function()'
There are already many examples of designs to understand foreign data
structures. The Lua bindings had pretty nice designs for that I though...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120221/7070e483/attachment-0001.html>


More information about the Digitalmars-d mailing list