www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - is there any plan to support shared libraries in OSX?

reply Timothee Cour <thelastmammoth gmail.com> writes:
Supporting shared libraries seems like a pretty important issue, IMO
more important than many things being worked on. I can't think of
other languages not supporting them; it renders many use cases
impossible, preventing more widespread adoption.

Is it on the roadmap? It's been a very long standing issue.

Recent issues I reported:

https://issues.dlang.org/show_bug.cgi?id=18046 Issue 18046 - dmd
-unittest doesn't work when linking against a shared library

https://issues.dlang.org/show_bug.cgi?id=18055  Issue 18055 -
exception handling cause EXC_BAD_ACCESS when linking against shared
libraries using vibe

There are other issues I've reported before regarding shared libraries as well.

ldc has better support but we lose compile time speed of dmd.
Dec 10 2017
next sibling parent roman <rto aol.com> writes:
On Sunday, 10 December 2017 at 21:00:08 UTC, Timothee Cour wrote:
 Supporting shared libraries seems like a pretty important 
 issue, IMO more important than many things being worked on. I 
 can't think of other languages not supporting them; it renders 
 many use cases impossible, preventing more widespread adoption.

 Is it on the roadmap? It's been a very long standing issue.

 Recent issues I reported:

 https://issues.dlang.org/show_bug.cgi?id=18046 Issue 18046 - 
 dmd -unittest doesn't work when linking against a shared library

 https://issues.dlang.org/show_bug.cgi?id=18055  Issue 18055 - 
 exception handling cause EXC_BAD_ACCESS when linking against 
 shared libraries using vibe

 There are other issues I've reported before regarding shared 
 libraries as well.

 ldc has better support but we lose compile time speed of dmd.
+100 and that for win too
Dec 10 2017
prev sibling next sibling parent David Nadlinger <code klickverbot.at> writes:
On Sunday, 10 December 2017 at 21:00:08 UTC, Timothee Cour wrote:
 ldc has better support
Just to be clear, LDC doesn't aim at incrementally "better support", but support, full stop. Granted, it has probably seen less real-world use than shared library support on Linux so there might be some bugs still, but the design should be technically sound.
 but we lose compile time speed of dmd
It might be true that non-release builds in DMD are a bit quicker to compile, but the difference definitely isn't large enough to "render[s] many use cases impossible, preventing more widespread adoption" as you mentioned earlier. Yes, having shared library support in DMD would certainly be nice to have (given that there is already a working implementation, that shouldn't even be too difficult). But in the meantime, there is a perfectly workable alternative. —David
Dec 10 2017
prev sibling parent Jacob Carlborg <doob me.com> writes:
On 2017-12-10 22:00, Timothee Cour wrote:

 Is it on the roadmap? It's been a very long standing issue.
I don't think it's on the roadmap. Nobody has needed it badly enough to implement it. I could probably give it a shot if someone implements constructors, i.e. __attribute__((constructor)), which is basically what this PR is doing [1]. [1] https://github.com/dlang/dmd/pull/7182 -- /Jacob Carlborg
Dec 11 2017