Dynamic Library Support for D

Martin Nowak code at dawg.eu
Thu Jan 2 11:30:18 PST 2014


On 01/02/2014 07:22 PM, Jeroen Bollen wrote:
> Currently D has a very poor support for creating and loading dynamic
> libraries. It requires a bunch of code while other languages like C just
> allow you to create it as you would create a static library.
>
> A problem here seems to be that D wants to integrate as much as possible
> with other languages, resulting in very poor support for integrating
> with it's own language.
There are plans to make it much simpler.
http://dconf.org/2013/talks/nowak.html
>
> I understand that the problem here is that the libraries get saved as
> .so or .dll, which should also linkable with other, non-D, applications,
> meaning the runtime cannot initialize on it's own.
The runtime just needs to become a .so or .dll itself.

> Why isn't there a D-specific format for dynamic libraries, that just
> shares the garbage collector with the main application, and thus only
> allow you to link it with D programs, and that way make it way easier to
> write a dynamic library in D.
>
It's a good idea to integrate with existing technologies and it's rather 
less effort than creating our own infrastructure.

> I guess the only reason this doesn't exist is because it'll take a lot
> of work?



More information about the Digitalmars-d mailing list