Thread overview | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
July 06, 2005 std.loader comments | ||||
---|---|---|---|---|
| ||||
2 comments/questions about std.loader: 1) can we change the vocabulary from using "module" to something like "library"? The word "module" already has meaning in D and it isn't what std.loader means. 2) why do we need init and uninit? They just inc and dec a counter. It seems odd to me. |
July 06, 2005 Re: std.loader comments | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ben Hinkle | Ben Hinkle wrote:
> 2 comments/questions about std.loader:
> 1) can we change the vocabulary from using "module" to something like "library"? The word "module" already has meaning in D and it isn't what std.loader means.
> 2) why do we need init and uninit? They just inc and dec a counter. It seems odd to me.
That whole module needs to be rewritten from scratch...
I think Matthew already apologized publically for it ? :-)
(as it looks like it was just a quick port over from C++)
I believe there is a re-implementation in "Derelict"
already, since std.loader was also *missing* from
libphobos.a in earlier versions of the Linux DMD ?
--anders
|
July 06, 2005 Re: std.loader comments | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anders F Björklund | "Anders F Björklund" <afb@algonet.se> wrote in message news:dagi4h$251d$1@digitaldaemon.com... > Ben Hinkle wrote: > >> 2 comments/questions about std.loader: >> 1) can we change the vocabulary from using "module" to something like >> "library"? The word "module" already has meaning in D and it isn't what >> std.loader means. >> 2) why do we need init and uninit? They just inc and dec a counter. It >> seems odd to me. > > That whole module needs to be rewritten from scratch... > I think Matthew already apologized publically for it ? :-) > (as it looks like it was just a quick port over from C++) > > I believe there is a re-implementation in "Derelict" already, since std.loader was also *missing* from libphobos.a in earlier versions of the Linux DMD ? > > --anders Without knowing what the plans are for phobos and/or std.loader I hope it gets attention sooner rather than later. I'm using it now and it work ok. Can the derelict version be sent to Walter for replacement? Anyone want to stand up for the derelict version? |
July 06, 2005 Re: std.loader comments | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anders F Björklund | Anders F Björklund wrote: > Ben Hinkle wrote: > >> 2 comments/questions about std.loader: >> 1) can we change the vocabulary from using "module" to something like "library"? The word "module" already has meaning in D and it isn't what std.loader means. >> 2) why do we need init and uninit? They just inc and dec a counter. It seems odd to me. > > > That whole module needs to be rewritten from scratch... > I think Matthew already apologized publically for it ? :-) > (as it looks like it was just a quick port over from C++) > > I believe there is a re-implementation in "Derelict" > already, since std.loader was also *missing* from > libphobos.a in earlier versions of the Linux DMD ? As far as I know, std.loader was never compiled into the linux version of phobos. That's why derelict implemented its own, that and well, std.loader is a mess. > > --anders I'd vote to replace the current std.loader with this http://svn.dsource.org/projects/derelict/trunk/DerelictUtil/derelict/util/ (name changes from 'derelict' to 'phobos' might be needed), but Walter has to remember to compile it into the linux version of phobos! (you can double check by using 'grep 'loader' libphobos.a') Otherwise, the linux users will still have to provide their own. |
July 06, 2005 Re: std.loader comments | ||||
---|---|---|---|---|
| ||||
Posted in reply to clayasaurus | In article <dagufn$2euf$1@digitaldaemon.com>, clayasaurus says... > >Anders F Björklund wrote: >> Ben Hinkle wrote: >> >>> 2 comments/questions about std.loader: >>> 1) can we change the vocabulary from using "module" to something like >>> "library"? The word "module" already has meaning in D and it isn't >>> what std.loader means. >>> 2) why do we need init and uninit? They just inc and dec a counter. It >>> seems odd to me. >> >> >> That whole module needs to be rewritten from scratch... >> I think Matthew already apologized publically for it ? :-) >> (as it looks like it was just a quick port over from C++) >> >> I believe there is a re-implementation in "Derelict" already, since std.loader was also *missing* from libphobos.a in earlier versions of the Linux DMD ? > >As far as I know, std.loader was never compiled into the linux version of phobos. That's why derelict implemented its own, that and well, std.loader is a mess. > >> >> --anders > >I'd vote to replace the current std.loader with this http://svn.dsource.org/projects/derelict/trunk/DerelictUtil/derelict/util/ (name changes from 'derelict' to 'phobos' might be needed), but Walter has to remember to compile it into the linux version of phobos! (you can double check by using 'grep 'loader' libphobos.a') > >Otherwise, the linux users will still have to provide their own. While we're on the topic of std.loader, has anyone taken a look at the one I wrote for DSP? http://svn.dsource.org/projects/dsp/trunk/misc/Library.d I haven't had a chance to compile it on Linux, but in theory the Linux portion should work fine. There are some companion classes (also in the /misc directory) that are designed to work with it too, such as the LibraryCache and DllStub that make some dll-related chores easier to handle. - EricAnderton at yahoo |
July 06, 2005 Re: std.loader comments | ||||
---|---|---|---|---|
| ||||
Posted in reply to clayasaurus | > I'd vote to replace the current std.loader with this http://svn.dsource.org/projects/derelict/trunk/DerelictUtil/derelict/util/ (name changes from 'derelict' to 'phobos' might be needed), but Walter has to remember to compile it into the linux version of phobos! (you can double check by using 'grep 'loader' libphobos.a') > > Otherwise, the linux users will still have to provide their own. Very nice, but please provide some meaningful error messages. It cannot be that all that is done on *any* failure is throwing an exception with the reason "i could not do that, sorry." If you don't know how to do that on the different systems, educate yourself our steal from Indigo. This is the documentation for the dynloader: http://www.uwesalomon.de/code/indigo/files/core/dynload-d.html And you will find the code for it in this archive: http://www.uwesalomon.de/code/indigo/indigo.tar.gz It is the following file: indigo/core/dynload.d It has operating-system independent checking of error messages. As you can see, the skeleton is from Kris' Mango library, but the rest of the code is mine. I release that part of indigo (dynload.d) into the public domain hereby, it is no longer under the GPL. Ciao uwe |
July 06, 2005 Re: std.loader comments | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ben Hinkle |
Ben, I think phobos authors perhaps decided to reserve init and uninit for
apropriate init() and fini() library functions (usually something like
__attribute__ ((constructor)) void init() for example) , which is IMHO
good...
Anyway, I think working (on Linux) std.loader is a very needed feature.
Kind regards
Dejan
--
...........
Dejan Lekic
http://dejan.lekic.org
|
July 06, 2005 Re: std.loader comments | ||||
---|---|---|---|---|
| ||||
Posted in reply to Uwe Salomon | Uwe Salomon wrote: > It has operating-system independent checking of error messages. As you can see, the skeleton is from Kris' Mango library, but the rest of the code is mine. I release that part of indigo (dynload.d) into the public domain hereby, it is no longer under the GPL. There's some questions about the Mac OS X specific parts of that code, so it will either need to be replaced with some new code - or have a special license provided - was using some sample code from dlcompat: /* Copyright (c) 2002 Peter O'Gorman <ogorman@users.sourceforge.net> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ Besides, the old darwin code is rather horrible and would be much shorter if just using CoreFoundation instead of dyld directly... So I think I will just "clean-room" rewrite it from scratch instead. This applies to Mango as well as Indigo and to the GDC Phobos patch too. (i.e. the stuff within the version(darwin) { } blocks) Sorry about that. Also put up a stuff on the Wiki4D, about remaining PhobosLicenseIssues. --anders |
July 06, 2005 Re: std.loader comments | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dejan Lekic | "Dejan Lekic" <leka@entropy.tmok.com> wrote in message news:dah4r4$2k1g$1@digitaldaemon.com... > > Ben, I think phobos authors perhaps decided to reserve init and uninit for > apropriate init() and fini() library functions (usually something like > __attribute__ ((constructor)) void init() for example) , which is IMHO > good... Are init/uninit for the library being loaded? They are just globals for the std.loader module independent of the library being loaded. I'm not sure why init/uninit aren't static ctor/dtor if the std.loader module needs initialization. |
July 06, 2005 Re: std.loader comments | ||||
---|---|---|---|---|
| ||||
Posted in reply to Uwe Salomon | Uwe Salomon wrote: >> I'd vote to replace the current std.loader with this http://svn.dsource.org/projects/derelict/trunk/DerelictUtil/derelict/util/ (name changes from 'derelict' to 'phobos' might be needed), but Walter has to remember to compile it into the linux version of phobos! (you can double check by using 'grep 'loader' libphobos.a') >> >> Otherwise, the linux users will still have to provide their own. > > I didn't write it (Mike Parker aka aldacron did), but it works well on both windows and linux. Here are the docs that explain how it works... http://svn.dsource.org/projects/derelict/trunk/docs/util.html Yes, it does need mac support, but adding that should be trivial. > Very nice, but please provide some meaningful error messages. It cannot be that all that is done on *any* failure is throwing an exception with the reason "i could not do that, sorry." If you don't know how to do that on the different systems, educate yourself our steal from Indigo. This is the documentation for the dynloader: > > http://www.uwesalomon.de/code/indigo/files/core/dynload-d.html > > And you will find the code for it in this archive: > > http://www.uwesalomon.de/code/indigo/indigo.tar.gz > > It is the following file: > > indigo/core/dynload.d > > It has operating-system independent checking of error messages. As you can see, the skeleton is from Kris' Mango library, but the rest of the code is mine. I release that part of indigo (dynload.d) into the public domain hereby, it is no longer under the GPL. > > Ciao > uwe |
Copyright © 1999-2021 by the D Language Foundation