digitalmars.D - A special treat
- Steve Teale (14/14) Feb 09 2010 When D2 is 'frozen', as a special treat would it be possible for it to b...
- Clemens (4/21) Feb 09 2010 Sorry if I'm stating the obvious, but have you looked at DDL?
- Steve Teale (4/11) Feb 09 2010 D1/Tango/not maintained/awful or no documentation - what more can I say?
- Steven Schveighoffer (18/31) Feb 09 2010 Many (including myself) have expressed the real requirement for shared
- Andrei Alexandrescu (4/45) Feb 09 2010 A lot of Phobos consists of templates, which would be difficult to put
- Craig Black (5/53) Feb 09 2010 Sure but I bet a lot of it doesn't consist of templates. Even with high...
- Steven Schveighoffer (13/55) Feb 09 2010 There is druntime, all the typeinfos, and much of phobos' templates will...
- Justin Johansson (8/32) Feb 09 2010 With respect, Andrei, that note is an irrelevant aside. There are not
- Don (3/20) Feb 09 2010 The inability to make Windows DLLs is, IMHO, the #1 show-stopper for D.
- Walter Bright (2/5) Feb 09 2010 The dmd/samples/d/dserver.d is an example of a Windows DLL in D.
- Steven Schveighoffer (16/21) Feb 09 2010 According to Don (haven't tried, because I don't have a windows box
- Walter Bright (8/33) Feb 09 2010 It is a bad problem, but it doesn't apply to implicitly loaded DLLs,
- Steven Schveighoffer (17/48) Feb 09 2010 But implicitly loaded DLLs aren't supported by D! However, I was not
- Walter Bright (7/24) Feb 09 2010 They aren't the same, even to a developer, as they do different things
- Steven Schveighoffer (4/5) Feb 09 2010 Yet nobody does, including Phobos. I wonder why...
- Justin Johansson (15/23) Feb 09 2010 I agree, Steve. Years ago when I did Windows programming with MFC
- Don (2/8) Feb 09 2010 It doesn't work on D2 because of the TLS issue.
- Jacob Carlborg (3/17) Feb 10 2010 I've compiled a couple of libraries as shared/dynamic libraries
When D2 is 'frozen', as a special treat would it be possible for it to be able to generate object files that could be converted into shared libraries, and for Phobos to be a shared library to support same. I have tried every which way I can think of to create shared libraries using D. The closest I have come is with the old 1.030 GDC, and even with that there are problems. I've tried to describe the current situation in some detail on the blog section of my <a href="http:// www.britseyeview.com/GDC-newbie.html">GDC-newbie page</a>. It is too long to post on the newsgroup. The inability to do this is a real show-stopper for D on Linux, and unless things have got better since I last tried, the same can be said for Windows DLLs. Please! Steve
Feb 09 2010
Steve Teale Wrote:When D2 is 'frozen', as a special treat would it be possible for it to be able to generate object files that could be converted into shared libraries, and for Phobos to be a shared library to support same. I have tried every which way I can think of to create shared libraries using D. The closest I have come is with the old 1.030 GDC, and even with that there are problems. I've tried to describe the current situation in some detail on the blog section of my <a href="http:// www.britseyeview.com/GDC-newbie.html">GDC-newbie page</a>. It is too long to post on the newsgroup. The inability to do this is a real show-stopper for D on Linux, and unless things have got better since I last tried, the same can be said for Windows DLLs. Please! SteveSorry if I'm stating the obvious, but have you looked at DDL? http://www.dsource.org/projects/ddl/ Clemens
Feb 09 2010
O>> Please!D1/Tango/not maintained/awful or no documentation - what more can I say? Thanks SteveSteveSorry if I'm stating the obvious, but have you looked at DDL? http://www.dsource.org/projects/ddl/ Clemens
Feb 09 2010
On Tue, 09 Feb 2010 10:53:47 -0500, Steve Teale <steve.teale britseyeview.com> wrote:When D2 is 'frozen', as a special treat would it be possible for it to be able to generate object files that could be converted into shared libraries, and for Phobos to be a shared library to support same. I have tried every which way I can think of to create shared libraries using D. The closest I have come is with the old 1.030 GDC, and even with that there are problems. I've tried to describe the current situation in some detail on the blog section of my <a href="http:// www.britseyeview.com/GDC-newbie.html">GDC-newbie page</a>. It is too long to post on the newsgroup. The inability to do this is a real show-stopper for D on Linux, and unless things have got better since I last tried, the same can be said for Windows DLLs. Please!Many (including myself) have expressed the real requirement for shared libraries. Sometimes the response is "oh who needs shared libraries anyways, there is so much memory in todays computers" and the other response is that "Windows DLLs suck, so we can't do it". I agree it needs to be figured out before D is considered a viable professional language. I don't think it's impossible, but someone just needs to spend the time. Another new problem to pile on to Windows DLLs is the new requirement for default thread local storage. See this bug that is very unlikely to get fixed (by Microsoft): http://d.puremagic.com/issues/show_bug.cgi?id=3342 So the tradeoff is, either use crappy TLS (using a function to look up global variables) or only support Windows Vista and later. If Windows 7 hadn't come out, I'd say requiring Vista is about as bad as not having DLLs :) -Steve
Feb 09 2010
Steven Schveighoffer wrote:On Tue, 09 Feb 2010 10:53:47 -0500, Steve Teale <steve.teale britseyeview.com> wrote:A lot of Phobos consists of templates, which would be difficult to put in a shared library. AndreiWhen D2 is 'frozen', as a special treat would it be possible for it to be able to generate object files that could be converted into shared libraries, and for Phobos to be a shared library to support same. I have tried every which way I can think of to create shared libraries using D. The closest I have come is with the old 1.030 GDC, and even with that there are problems. I've tried to describe the current situation in some detail on the blog section of my <a href="http:// www.britseyeview.com/GDC-newbie.html">GDC-newbie page</a>. It is too long to post on the newsgroup. The inability to do this is a real show-stopper for D on Linux, and unless things have got better since I last tried, the same can be said for Windows DLLs. Please!Many (including myself) have expressed the real requirement for shared libraries. Sometimes the response is "oh who needs shared libraries anyways, there is so much memory in todays computers" and the other response is that "Windows DLLs suck, so we can't do it". I agree it needs to be figured out before D is considered a viable professional language. I don't think it's impossible, but someone just needs to spend the time. Another new problem to pile on to Windows DLLs is the new requirement for default thread local storage. See this bug that is very unlikely to get fixed (by Microsoft): http://d.puremagic.com/issues/show_bug.cgi?id=3342 So the tradeoff is, either use crappy TLS (using a function to look up global variables) or only support Windows Vista and later. If Windows 7 hadn't come out, I'd say requiring Vista is about as bad as not having DLLs :) -Steve
Feb 09 2010
"Andrei Alexandrescu" <SeeWebsiteForEmail erdani.org> wrote in message news:hks6qm$26r3$1 digitalmars.com...Steven Schveighoffer wrote:Sure but I bet a lot of it doesn't consist of templates. Even with highly templated code, there is still a lot to be gained from this IMO. -CraigOn Tue, 09 Feb 2010 10:53:47 -0500, Steve Teale <steve.teale britseyeview.com> wrote:A lot of Phobos consists of templates, which would be difficult to put in a shared library. AndreiWhen D2 is 'frozen', as a special treat would it be possible for it to be able to generate object files that could be converted into shared libraries, and for Phobos to be a shared library to support same. I have tried every which way I can think of to create shared libraries using D. The closest I have come is with the old 1.030 GDC, and even with that there are problems. I've tried to describe the current situation in some detail on the blog section of my <a href="http:// www.britseyeview.com/GDC-newbie.html">GDC-newbie page</a>. It is too long to post on the newsgroup. The inability to do this is a real show-stopper for D on Linux, and unless things have got better since I last tried, the same can be said for Windows DLLs. Please!Many (including myself) have expressed the real requirement for shared libraries. Sometimes the response is "oh who needs shared libraries anyways, there is so much memory in todays computers" and the other response is that "Windows DLLs suck, so we can't do it". I agree it needs to be figured out before D is considered a viable professional language. I don't think it's impossible, but someone just needs to spend the time. Another new problem to pile on to Windows DLLs is the new requirement for default thread local storage. See this bug that is very unlikely to get fixed (by Microsoft): http://d.puremagic.com/issues/show_bug.cgi?id=3342 So the tradeoff is, either use crappy TLS (using a function to look up global variables) or only support Windows Vista and later. If Windows 7 hadn't come out, I'd say requiring Vista is about as bad as not having DLLs :) -Steve
Feb 09 2010
On Tue, 09 Feb 2010 12:42:46 -0500, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:Steven Schveighoffer wrote:There is druntime, all the typeinfos, and much of phobos' templates will likely be used in other parts of phobos. For example, if an XML library is template based on the character width, but one part of phobos uses the xml library based on char (for properties or something), then instantiating that template with char in your program code will leave the char-generated version in the phobos dynamic lib. The savings will be real. Most templated code is used in similar ways and so those uses can be consolidated into one shared library. It might even be worth pre-generating common templates even if they are not specifically used. -SteveOn Tue, 09 Feb 2010 10:53:47 -0500, Steve Teale <steve.teale britseyeview.com> wrote:A lot of Phobos consists of templates, which would be difficult to put in a shared library.When D2 is 'frozen', as a special treat would it be possible for it to be able to generate object files that could be converted into shared libraries, and for Phobos to be a shared library to support same. I have tried every which way I can think of to create shared libraries using D. The closest I have come is with the old 1.030 GDC, and even with that there are problems. I've tried to describe the current situation in some detail on the blog section of my <a href="http:// www.britseyeview.com/GDC-newbie.html">GDC-newbie page</a>. It is too long to post on the newsgroup. The inability to do this is a real show-stopper for D on Linux, and unless things have got better since I last tried, the same can be said for Windows DLLs. Please!Many (including myself) have expressed the real requirement for shared libraries. Sometimes the response is "oh who needs shared libraries anyways, there is so much memory in todays computers" and the other response is that "Windows DLLs suck, so we can't do it". I agree it needs to be figured out before D is considered a viable professional language. I don't think it's impossible, but someone just needs to spend the time. Another new problem to pile on to Windows DLLs is the new requirement for default thread local storage. See this bug that is very unlikely to get fixed (by Microsoft): http://d.puremagic.com/issues/show_bug.cgi?id=3342 So the tradeoff is, either use crappy TLS (using a function to look up global variables) or only support Windows Vista and later. If Windows 7 hadn't come out, I'd say requiring Vista is about as bad as not having DLLs :) -Steve
Feb 09 2010
Andrei Alexandrescu wrote:Many (including myself) have expressed the real requirement for shared libraries. Sometimes the response is "oh who needs shared libraries anyways, there is so much memory in todays computers" and the other response is that "Windows DLLs suck, so we can't do it". I agree it needs to be figured out before D is considered a viable professional language. I don't think it's impossible, but someone just needs to spend the time. Another new problem to pile on to Windows DLLs is the new requirement for default thread local storage. See this bug that is very unlikely to get fixed (by Microsoft): http://d.puremagic.com/issues/show_bug.cgi?id=3342 So the tradeoff is, either use crappy TLS (using a function to look up global variables) or only support Windows Vista and later. If Windows 7 hadn't come out, I'd say requiring Vista is about as bad as not having DLLs :) -SteveA lot of Phobos consists of templates, which would be difficult to put in a shared library. AndreiWith respect, Andrei, that note is an irrelevant aside. There are not many applications or application libraries that consist solely of templates. Shared libraries are sometimes the only way you can extend applications in Linux. e.g. Apache server modules. (No need to mention FastCGI workaround). Ditto Windows & DLL's. Justin
Feb 09 2010
Steve Teale wrote:When D2 is 'frozen', as a special treat would it be possible for it to be able to generate object files that could be converted into shared libraries, and for Phobos to be a shared library to support same. I have tried every which way I can think of to create shared libraries using D. The closest I have come is with the old 1.030 GDC, and even with that there are problems. I've tried to describe the current situation in some detail on the blog section of my <a href="http:// www.britseyeview.com/GDC-newbie.html">GDC-newbie page</a>. It is too long to post on the newsgroup. The inability to do this is a real show-stopper for D on Linux, and unless things have got better since I last tried, the same can be said for Windows DLLs. Please! SteveIt'll definitely get attention.
Feb 09 2010
Steve Teale wrote:The inability to do this is a real show-stopper for D on Linux, and unless things have got better since I last tried, the same can be said for Windows DLLs.The dmd/samples/d/dserver.d is an example of a Windows DLL in D.
Feb 09 2010
On Tue, 09 Feb 2010 15:58:37 -0500, Walter Bright <newshound1 digitalmars.com> wrote:Steve Teale wrote:According to Don (haven't tried, because I don't have a windows box handy), any D2 DLL will fail, even an empty one because of http://d.puremagic.com/issues/show_bug.cgi?id=3342 That aside, having to handle manual steps to ensure the runtime doesn't lose its mind is unacceptable. It has to be handled without any manual runtime coding to be a viable solution. DDL is not a solution, its a hack. In other words, I should be able to flip a compiler switch to build a shared lib, and I shouldn't have to do anything special aside from exporting symbols. This is the way it is in all other programming languages. Until Phobos is a shared lib, I don't think we need to have any discussions about any existing solutions. That is requirement number 1 for saying D supports shared libs. -SteveThe inability to do this is a real show-stopper for D on Linux, and unless things have got better since I last tried, the same can be said for Windows DLLs.The dmd/samples/d/dserver.d is an example of a Windows DLL in D.
Feb 09 2010
Steven Schveighoffer wrote:On Tue, 09 Feb 2010 15:58:37 -0500, Walter Bright <newshound1 digitalmars.com> wrote:It is a bad problem, but it doesn't apply to implicitly loaded DLLs, only dynamically loaded ones, and it also doesn't apply to Vista or Windows 7.Steve Teale wrote:According to Don (haven't tried, because I don't have a windows box handy), any D2 DLL will fail, even an empty one because of http://d.puremagic.com/issues/show_bug.cgi?id=3342The inability to do this is a real show-stopper for D on Linux, and unless things have got better since I last tried, the same can be said for Windows DLLs.The dmd/samples/d/dserver.d is an example of a Windows DLL in D.That aside, having to handle manual steps to ensure the runtime doesn't lose its mind is unacceptable. It has to be handled without any manual runtime coding to be a viable solution. DDL is not a solution, its a hack. In other words, I should be able to flip a compiler switch to build a shared lib, and I shouldn't have to do anything special aside from exporting symbols. This is the way it is in all other programming languages. Until Phobos is a shared lib, I don't think we need to have any discussions about any existing solutions. That is requirement number 1 for saying D supports shared libs.Shared libraries (on Linux) and Windows DLLs are very different things. Phobos as a DLL is a different problem than creating DLLs with D. DLLs in D can be created that are statically linked with Phobos, and that can be accessed by any executable in any language.
Feb 09 2010
On Tue, 09 Feb 2010 16:28:27 -0500, Walter Bright <newshound1 digitalmars.com> wrote:Steven Schveighoffer wrote:But implicitly loaded DLLs aren't supported by D! However, I was not aware that it only applied to dynamically loaded ones, that is good to know.On Tue, 09 Feb 2010 15:58:37 -0500, Walter Bright <newshound1 digitalmars.com> wrote:It is a bad problem, but it doesn't apply to implicitly loaded DLLs, only dynamically loaded ones, and it also doesn't apply to Vista or Windows 7.Steve Teale wrote:According to Don (haven't tried, because I don't have a windows box handy), any D2 DLL will fail, even an empty one because of http://d.puremagic.com/issues/show_bug.cgi?id=3342The inability to do this is a real show-stopper for D on Linux, and unless things have got better since I last tried, the same can be said for Windows DLLs.The dmd/samples/d/dserver.d is an example of a Windows DLL in D.Yes, I agree they are two different problems to solve. But to a developer, they look the same.That aside, having to handle manual steps to ensure the runtime doesn't lose its mind is unacceptable. It has to be handled without any manual runtime coding to be a viable solution. DDL is not a solution, its a hack. In other words, I should be able to flip a compiler switch to build a shared lib, and I shouldn't have to do anything special aside from exporting symbols. This is the way it is in all other programming languages. Until Phobos is a shared lib, I don't think we need to have any discussions about any existing solutions. That is requirement number 1 for saying D supports shared libs.Shared libraries (on Linux) and Windows DLLs are very different things.Phobos as a DLL is a different problem than creating DLLs with D. DLLs in D can be created that are statically linked with Phobos, and that can be accessed by any executable in any language.They can be accessed by another D program? My understanding is that all kinds of weird problems happen if you dynamically link two D programs together. I'm not speaking from first-hand experience, I may be wrong. It is very important that Phobos be a dynamic library and that you can build dynamic libraries easily without manual manipulation of the runtime. If these two things are accomplished, then D can say it supports dynamic libraries, not before. Half ass support doesn't count. It's like saying a car has a cup holder because you can wedge your cup between the seat and the e-brake. -Steve
Feb 09 2010
Steven Schveighoffer wrote:But implicitly loaded DLLs aren't supported by D!Sure they are, see the program in dmd/samples/dThey aren't the same, even to a developer, as they do different things and behave very differently.Shared libraries (on Linux) and Windows DLLs are very different things.Yes, I agree they are two different problems to solve. But to a developer, they look the same.At a minimum, if you expose a C interface from your DLL, it can interact with any other DLL.Phobos as a DLL is a different problem than creating DLLs with D. DLLs in D can be created that are statically linked with Phobos, and that can be accessed by any executable in any language.They can be accessed by another D program? My understanding is that all kinds of weird problems happen if you dynamically link two D programs together. I'm not speaking from first-hand experience, I may be wrong.It is very important that Phobos be a dynamic library and that you can build dynamic libraries easily without manual manipulation of the runtime. If these two things are accomplished, then D can say it supports dynamic libraries, not before. Half ass support doesn't count.There's still a lot you can do with DLLs and D.
Feb 09 2010
On Tue, 09 Feb 2010 17:01:10 -0500, Walter Bright <newshound1 digitalmars.com> wrote:There's still a lot you can do with DLLs and D.Yet nobody does, including Phobos. I wonder why... -Steve
Feb 09 2010
Steven Schveighoffer wrote:It is very important that Phobos be a dynamic library and that you can build dynamic libraries easily without manual manipulation of the runtime. If these two things are accomplished, then D can say it supports dynamic libraries, not before. Half ass support doesn't count. It's like saying a car has a cup holder because you can wedge your cup between the seat and the e-brake. -SteveI agree, Steve. Years ago when I did Windows programming with MFC (Microsoft Foundation Classes), I had a preference for statically linking the MFC libraries with my app to avoid the DLL hell problem. However it was, and still is, possible to dynamically link with MFC DLL's and this is often the preferred manner, if not the norm, for Windows developers. One could think of the Phobos runtime as being analogous to the MFC runtime. Why should there be different treatment, i.e. you can do MFC programming with MFC DLL but not D programming with Phobos DLL? Ditto for shared objects under Linux. If D is supposed to be a "systems programming language", you expect that it be able to do all manner of "systems things", including being able to do shared object libraries and DLL's on the respective platforms. Cheers, Justin Johansson
Feb 09 2010
Walter Bright wrote:Steve Teale wrote:It doesn't work on D2 because of the TLS issue.The inability to do this is a real show-stopper for D on Linux, and unless things have got better since I last tried, the same can be said for Windows DLLs.The dmd/samples/d/dserver.d is an example of a Windows DLL in D.
Feb 09 2010
On 2/9/10 16:53, Steve Teale wrote:When D2 is 'frozen', as a special treat would it be possible for it to be able to generate object files that could be converted into shared libraries, and for Phobos to be a shared library to support same. I have tried every which way I can think of to create shared libraries using D. The closest I have come is with the old 1.030 GDC, and even with that there are problems. I've tried to describe the current situation in some detail on the blog section of my<a href="http:// www.britseyeview.com/GDC-newbie.html">GDC-newbie page</a>. It is too long to post on the newsgroup. The inability to do this is a real show-stopper for D on Linux, and unless things have got better since I last tried, the same can be said for Windows DLLs. Please! SteveI've compiled a couple of libraries as shared/dynamic libraries (including tango) using gdc on Mac OS X. I can't remeber I had any problems.
Feb 10 2010