D as A Better C?

Adam Wilson flyboynw at gmail.com
Tue Feb 11 12:17:54 PST 2014


On Tue, 11 Feb 2014 11:43:02 -0800, Walter Bright  
<newshound2 at digitalmars.com> 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?

I see this as a very good idea. It would make bootstrapping the language  
to new architectures or compiler backends much simpler. It would make the  
embedded/real-time folks happy. Then we could use that subset to create a  
Phobos-Core subset that worked on D-Core and could be trivially ported  
onto any new platform that has the C standard library.

I don't see the complexity argument as relevant. If properly designed such  
that the Core has absolutely no requirement on higher level features then  
all you're doing is building the higher level features on the "library" of  
Core features. We all do this kind of thing every day. :-)

-- 
Adam Wilson
GitHub/IRC: LightBender
Aurora Project Coordinator


More information about the Digitalmars-d mailing list