Window creation, for phobos?

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 27 23:59:45 PST 2015


On Wed, 28 Jan 2015 10:36:22 +0900, Mike Parker wrote:

> On 1/28/2015 7:54 AM, ketmar wrote:
>> On Wed, 28 Jan 2015 11:04:55 +1300, Rikki Cattermole wrote:
>>
>>> First off, Derelict-Util/Derelict-GL3 is a biggy here. Its old code,
>>> lets admit it. Its also a standard for loading shared library
>>> functions.
>>
>> please, not Derelict! it's a great work and all that, but it's habit to
>> load ALL functions is nasty. not only it is unnecessary, it's sometimes
>> just wrong. i recall the problem with DlangUI, where Derelict tries to
>> load FreeImage function which is not in my (old) version of the
>> library,
>> and DlangUI is not using that function at all. yet DlangUI builds
>> successfully and then failed to run until i commented out that
>> function.
>>
>>
> For several years, Derelict has had a feature I call "selective symbol
> loading" to allow people to load older versions of a library with a
> newer version of Derelict. All they need to do is implement a callback
> that checks the name of a missing function and return a value indicating
> if loading should continue or an exception should be thrown. Very few
> people use it.
> 
> After seeing your post about FreeImage in the DLangUI thread a few weeks
> back, I added a new feature to DerelictUtil which automates the
> selective symbol loading. It's now possible to specify a minimum version
> of a library and the loader will not throw an exception if a function is
> missing. It doesn't make sense for some Derelict packages to make use of
> it, but I did add it to the FreeImage loader.
> 
> At any rate, I can't automate it fully. There's no way for me to know if
> any given program requires a function that's isn't present in an older
> version of a library or not. Derelict users have to take some
> responsibility in determining the absolute minimum version they need to
> support.

please note that i'm not saying that Derelict is bad. sure, you can't 
properly determine what API program requires... but the compiler can. 
loading dynamic library by the way Derelict does has it's advantages, and 
i don't want to tell that Derelict is "invalid". the only thing i meant 
to say is that i don't think that using Derelict method of loading 
libraries should be in Phobos -- 'cause people will forget to provide 
callbacks, and 'cause someone may have library installed in some obscure 
place, which 'pkg-config' knows, but Derelict don't, so linker is able to 
find the library, but code using Derelict must be fixed manually.

there is nothing wrong in using Derelict in people's projects, i just 
don't think that it is suitable for inclusion in standard library.

i'm sorry if it seems that i'm somehow marking Derelict as "done wrong".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150128/5213abff/attachment.sig>


More information about the Digitalmars-d mailing list