Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 239
Target-san Avatar asked Nov 15 '10 08:11

Target-san


1 Answers

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 ?

like image 64
Michal Minich Avatar answered Sep 30 '22 11:09

Michal Minich