A betterC modular standard library?

Ilya Yaroshenko via Digitalmars-d digitalmars-d at puremagic.com
Tue Dec 20 01:56:34 PST 2016


On Tuesday, 20 December 2016 at 09:38:58 UTC, rikki cattermole 
wrote:
> On 20/12/2016 10:32 PM, Ilya Yaroshenko wrote:
>> On Tuesday, 20 December 2016 at 09:12:55 UTC, Timothee Cour 
>> wrote:
>>> @ilya: regarding -betterC 's stated goal to bypass druntime:
>>>
>>> besides static linking (which can be inefficient), why not 
>>> use runtime
>>> shared libraries to distribute mir (eg GLAS) to C clients ?
>>>
>>> IIRC, from a single C++ program, I am able to dlopen & dlsym 
>>> & run D
>>> functions defined in shared libraries built with different 
>>> compilers
>>> (eg dmd and ldc) even if they use GC (and therefore dmd's and 
>>> ldc's
>>> druntime) ; pseudocode:
>>>
>>> // main.cpp
>>> ```
>>> void main(){
>>>   dlopen, dlsym, and run "void fun1()" from libfun_dmd.so
>>>   dlopen, dlsym, and run "void fun2()" from libfun_ldc.so
>>> }
>>> ```
>>>
>>> That would provide the needed isolation without suffering from
>>> disadvantages of static libraries (eg bloat); compared to the 
>>> betterC
>>> alternative, you'd have access to all of druntime/phobos and 
>>> not have
>>> to reinvent the wheel
>>
>> Because I do not have control on phobos, i can not distribute 
>> my copy of
>> phobos with required patches like normal cache size estimation
>> (core.cpuid is broken). Why not to fix core.cpuid?  Its source 
>> code is
>> not manageable comparing with mir-cpuid: it is faster to write 
>> a module
>> from scratch for this case. DUB package appears when I want 
>> it, LDC
>> release may appear after 6-10 months (depends on distribution).
>
> Of course you can bundle your own Phobos.
> If you put a std.* module in your path your build will be 
> working against that instead. If you don't mess around with 
> sc.ini it will override the default for that compilation.

CPUID should be precompiled. So this does not work. If GLAS do 
not need anything but CPUID, what the reason to depend on 
DRuntime?

Please stop to force me to use DRuntime because you think it is 
better for Mir projects. This looks like DRuntime religion.

A betterC library can be used with DRuntime. So I do not force 
anyone to drop DRuntime. Please do not force me to use it.

GLAS already works without DRuntime and I am happy about that.



More information about the Digitalmars-d mailing list