D as A Better C?

Brian Rogoff brogoff at gmail.com
Tue Feb 11 13:00:48 PST 2014


On Tuesday, 11 February 2014 at 19:43:00 UTC, Walter Bright wrote:
> 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?

Which D metaprogramming (templates, mixins, ctfe, ..) features 
would be in this D subset?

Would the non-gc'ed functional programming features (downward 
funargs) be in the subset?

If the answers are "all and yes" I'd be very interested, if "none 
and no" then much less interested. Please say more about which 
features you expect to make the cut.

D-lite, while already used, is the natural name choiec.

As others point out, there's some risk of fragmentation, but 
there's precedent even in unsubsettable languages like Ada 
(SPARK) so I don't think the risk is so great.

-- Brian


More information about the Digitalmars-d mailing list