www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D and shared librery

reply boolangery <eliott.dumeix gmail.com> writes:
Hi,

I didn't find resources on what are actually supported with D and 
shared library.

I need to reduce binary size, so I would like to ship all 
dependencies as shared

I read on some forum that shared library is conflicting with 
garbage collection of the druntime ?

I absolutely need shared library due to space constraints (and 
multiple binaries  ),so I need to know if D should be abandoned.

Thanks
Jul 01 2018
next sibling parent reply rikki cattermole <rikki cattermole.co.nz> writes:
On 02/07/2018 1:53 AM, boolangery wrote:
 Hi,
 
 I didn't find resources on what are actually supported with D and shared 
 library.
 
 I need to reduce binary size, so I would like to ship all dependencies 
 as shared
 
 I read on some forum that shared library is conflicting with garbage 
 collection of the druntime ?
 
 I absolutely need shared library due to space constraints (and multiple 
 binaries  ),so I need to know if D should be abandoned.
 
 Thanks
You should abandon D if you require (hard no compromise): 1) Shared libraries (D, not e.g. C) AND 2) Languages features like classes (and with it type info) AND 3) Cross platform support (Windows mostly is the problem atm) Some may say, but it works for me! But it doesn't work for most users. It simply hasn't been designed as an experience.
Jul 01 2018
parent reply Seb <seb wilzba.ch> writes:
On Sunday, 1 July 2018 at 14:05:30 UTC, rikki cattermole wrote:
 On 02/07/2018 1:53 AM, boolangery wrote:
 Hi,
 
 I didn't find resources on what are actually supported with D 
 and shared library.
 
 I need to reduce binary size, so I would like to ship all 
 dependencies as shared
 
 I read on some forum that shared library is conflicting with 
 garbage collection of the druntime ?
 
 I absolutely need shared library due to space constraints (and 
 multiple binaries  ),so I need to know if D should be 
 abandoned.
 
 Thanks
You should abandon D if you require (hard no compromise): 1) Shared libraries (D, not e.g. C)
Shared libraries are working fine on Linux and OSX. For example, on ArchLinux LDC builds shared libraries by default. Maybe you have recently run into an issue on Windows and are frustrated because of this?
 AND
 2) Languages features like classes (and with it type info)
What's wrong about D's classes?
 3) Cross platform support (Windows mostly is the problem atm)

 Some may say, but it works for me! But it doesn't work for most 
 users.
 It simply hasn't been designed as an experience.
I hear a lot of frustration here, but even though one might hit a bump here and there, it doesn't mean that D hasn't been designed to have a nice experience. Did you post your issues to the #dbugfix campaign?
Jul 01 2018
parent Jacob Carlborg <doob me.com> writes:
On 2018-07-02 04:15, Seb wrote:

 Shared libraries are working fine on Linux and OSX.
For macOS LDC is required. -- /Jacob Carlborg
Jul 04 2018
prev sibling parent reply Seb <seb wilzba.ch> writes:
On Sunday, 1 July 2018 at 13:53:12 UTC, boolangery wrote:
 Hi,

 I didn't find resources on what are actually supported with D 
 and shared library.
 I didn't find resources on what are actually supported with D 
 and shared library.
https://dlang.org/articles/dll-linux.html https://dconf.org/2013/talks/nowak.html The docs: https://dlang.org/phobos/core_runtime.html
 I read on some forum that shared library is conflicting with 
 garbage collection of the druntime ?
I haven't heard about issues with this. Also the garbage collection is enabled lazily since 2.080. Druntime itself can be linked as a shared library too btw.
 I absolutely need shared library due to space constraints (and 
 multiple binaries  ),so I need to know if D should be abandoned.
On which OS/architecture do you plan to ship your binaries? D doesn't have full support for creating Windows DLLs, but there's active work on this: https://forum.dlang.org/post/shonvwuauwbhrszysmrz forum.dlang.org
Jul 01 2018
parent boolangery <eliott.dumeix gmail.com> writes:
On Monday, 2 July 2018 at 02:26:45 UTC, Seb wrote:
 On which OS/architecture do you plan to ship your binaries?
 D doesn't have full support for creating Windows DLLs, but 
 there's active work on this:
I'am targeting linux-gnueabi on ARM, but currently doing some local test on my x86 linux. Using ldc2 do you have some example ? (building a shared library and linking it in another app) Thanks
Jul 01 2018