D is dead (was: Dicebot on leaving D: It is anarchy driven development in all its glory.)

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Tue Sep 4 17:07:56 UTC 2018


On Friday, 24 August 2018 at 13:21:25 UTC, Jonathan M Davis wrote:
> On Friday, August 24, 2018 6:05:40 AM MDT Mike Franklin via 
> Digitalmars-d wrote:
>> > You're basically trying to bypass the OS' public API if 
>> > you're trying to bypass libc.
>>
>> No I'm trying to bypass libc and use the OS API directly.
>
> And my point is that most OSes consider libc to be their OS API 
> (Linux doesn't, but it's very much abnormal in that respect).

Well, it used to be the case that it was normal to call OS 
directly by using traps, but since the context switch is so 
expensive on modern CPUs we a have a situation where the calling 
stub is a fraction of the calling cost these days. Thus most 
don't bother with it.

What usually can happen if you don't use the c-stubs with dynamic 
linkage is that your precompiled program won't work with new 
versions of the OS. But that can also happen with static linkage.

> Trying to bypass it means reimplementing core OS functionality 
> and risking all of the bugs that go with it.

It is the right thing to do for a low level language. Why have 
libc as a dependency if you want to enable hardware oriented 
programming? Using existing libraries also put limits on low 
level language semantics.

> If you're talking about avoiding libc functions like strcmp 
> that's one thing, but if you're talking about reimplementing 
> stuff that uses syscalls, then honestly, I think that you're 
> crazy.

No it isn't a crazy position, why the hostile tone? Libc isn't 
available in many settings. Not even in webassembly.




More information about the Digitalmars-d mailing list