Target-san
Target-san

Reputation: 461

D runtime as DLL

Does anyone know if at least D runtime and Phobos for D 2 will be pre-built as DLLs or at least ready to be compiled in such a way? Currently, as I understand, it will require to mark all relevant functions and/or classes as export. Couldn't find anything similar in current sources of DMD. Thanks.

Upvotes: 7

Views: 389

Answers (1)

Michal Minich
Michal Minich

Reputation: 2667

Currently, Phobos is available as pre-built LIB file, which is statically linked to your executable during compilation.

This has some advantages to DLL:

  • Deployment - you can be always sure that your executable have appropriate runtime/gc/phobos available - the one which is tested with your application. There is new version of Phobos and D runtime every month, using DLLs in this case could cause versioning problems.

Disadvantages

  • Executable size is slightly larger (100s of kb)
  • Every "unit" exe / dll has its own garbage collector.

Why are you researching options of using DLL for Phobos? What insufficiencies do you seen in using LIB ?

Upvotes: 6

Related Questions