Ideas for runtime loading of shared libraries.

Jonathan M Davis jmdavisProg at gmx.com
Thu Mar 7 16:44:01 PST 2013


On Thursday, March 07, 2013 13:48:21 Walter Bright wrote:
> My idea for this is straightforward. A D plugin should use a C interface.
> That means, for example, that a D plugin should NOT pass GC allocated
> references to its caller. Only malloc'd data should pass between the plugin
> and its caller.
> 
> The D plugin could still use the shared druntime.so, and could share that
> usage with the D caller of the plugin.

That may very well end up being a necessary restriction, but not being able to pass
GC allocated objects across library boundaries would be a _huge_ downside to using
shared libraries if that happens. It also would likely be a major source of bugs
as it's pretty much a guarantee that a lot of people would do it unless the compiler
prevented them in some manner.

- Jonathan M Davis


More information about the Digitalmars-d mailing list