D as A Better C?

Marco Leise Marco.Leise at gmx.de
Mon Feb 17 00:04:52 PST 2014


Am Tue, 11 Feb 2014 11:43:02 -0800
schrieb Walter Bright <newshound2 at digitalmars.com>:

> I've toyed with this idea for a while, and wondered what the interest there is 
> in something like this.
> 
> The idea is to be able to use a subset of D that does not require any of 
> druntime or phobos - it can be linked merely with the C standard library. To 
> that end, there'd be a compiler switch (-betterC) which would enforce the subset.
> 
> (First off, I hate the name "better C", any suggestions?)
> 
> The subset would disallow use of any features that rely on:
> 
> 1. moduleinfo
> 2. exception handling
> 3. gc
> 4. Object
> 
> I've used such a subset before when bringing D up on a new platform, as the new 
> platform didn't have a working phobos.
> 
> What do you think?

That sounds like it has use cases and doesn't create anything
new, just restrict the feature set like @safe.
I expect that it is much easier to port D to all kinds of
platforms where it is a lot of work or even impossible to
implement all of D's features. Since objects and the GC are
out, it means that D threads are also out.
What about TLS? It has proven difficult on previous MacOS X
versions already and might cause trouble on other platforms.

This morning I talked with my father about the use of Python
in controlling motors and sensors for the saws he is
constructing at work. I don't know how Python works on such an
embedded platform, but I could see "better C" there as well.
Especially since Python did cause trouble when real time
feedback was required.

-- 
Marco



More information about the Digitalmars-d mailing list