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

Mike Franklin slavo5150 at yahoo.com
Fri Aug 24 12:05:40 UTC 2018


On Friday, 24 August 2018 at 11:15:21 UTC, Jonathan M Davis wrote:

> Linux is the only OS I'm aware of that considers the syscall 
> layer to be something that anything outside the OS would 
> normally call.

I think Linux considers system calls the OS API.

> Other OSes consider libc to be part of the OS.

Not Windows.  Windows has it's own API, and when interfacing with 
the OS, I never use libc.

> In theory, you could call the syscalls directly in the BSDs 
> (and probably on Mac OS), but the expectation is that you're 
> going to use libc.

That's the expectation for application programming, not systems 
programming.

> Calling them directly would be way more error-prone, since 
> you'd basically have to reimplement portions of libc and have 
> to deal with any changes they make which normally would be 
> hidden by libc.

Most of what we need is already implemented in the language, 
druntime, and Phobos.  We just need a few fundamental building 
blocks that are currently implemented in C and a few calls into 
the OS APIs (syscalls for linux, Window API for Windows, not sure 
about Mac...probably syscalls).  And just like DMD benefited from 
being written in D, so would those building-blocks, and the code 
that calls into them.

> 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.

> Honestly, I don't see how it's at all reasonable to be trying 
> to access syscalls directly rather than using libc under any 
> kind of normal circumstances - especially if you're not on 
> Linux.

I think it'd be nice if D were freestanding and portable without 
requiring libraries written in other languages.  Purity, safety, 
CTFE, introspection, etc... all the way down.

Mike




More information about the Digitalmars-d mailing list