A betterC modular standard library?

Ilya Yaroshenko via Digitalmars-d digitalmars-d at puremagic.com
Sun Dec 18 12:10:22 PST 2016


On Sunday, 18 December 2016 at 19:28:24 UTC, Andrei Alexandrescu 
wrote:
> On 12/18/2016 01:49 PM, Ilya Yaroshenko wrote:
>> On Sunday, 18 December 2016 at 17:41:31 UTC, Walter Bright 
>> wrote:
>>> On 12/18/2016 1:26 AM, Ilya Yaroshenko wrote:
>>>> We already have better `cpuid` and better `random` packages.
>>>
>>> Great! Please PR them for Phobos.
>>
>> cpuid is used in Mir GLAS and it should be a betterC library.
>
> It's this kind of imaginary dialog that I don't quite grok:
>
> Ilya Yaroshenko: "I can't use druntime's cpuid so I defined my 
> own." [...]
> IY: "..."
>
> It's this kind of stuff I need to have a better understanding 
> of. Some technical arguments are meaningful, some others point 
> to problems with obvious solutions that are somehow shunned, 
> and yet others are like a hidden Markov model - I see the 
> effects, but I don't see the causes.
>
>
> Andrei


My last argument was:
----
Linking compatibility. Assume A has builded a betterC library AA 
using GDC version XXX and B has builded a betterC library BB 
using LDC version YYY.

Question: how mister C can use BB and AA together in his 
C-library if both this libraries depends on different DRuntimes 
(compiler and version)?
----

DRuntime is large and evaluates fast. We have not backward binary 
compatibility in DRuntime and we have not binary compatibility 
between different compiler versions.

mir-glas is a betterC library for all languages.  It depends in 
mir-cpuid. I want mir-glas to replace OpenBLAS. To do it I need 
the same portability.

OK, assume we already have DRuntime for all targets including 
MIPS, POWER, armv7, aarch64, Loongson.

Does this solves problem? No.

The reason is very simple. All non-betterC D libraries must be 
compiled in lockstep: with the same compiler vendor and druntime 
version!

This will just kill GLAS. How this can be packed for Ubuntu for 
example? It will depends on LDC libphobos == XXX. Another numeric 
library, say FFT, will depend on libphobos == YYY by GDC. How 
they can be linked if they require different DRuntime from 
different compilers? Or different druntime versions for the same 
compiler?

Do you want to constraint D users to do not distribute binary 
libraries in popular repositories like Debian/Ubuntu?

DRuntime incompatibility is a huge constraints for business. Do 
you want to force all companies to use identical version of 
compiler and identical vendor?

Yes, C++ changes their API, but it few orders of magnitude slower 
then D. And they support multiple branches with bugs fixes. D 
supports only the recent one.

This is why GLAS/cpuid need to be a betterC library.

Ilya



More information about the Digitalmars-d mailing list