What would a minimal subset of D look like?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Sat Jun 22 16:49:09 UTC 2019


On Saturday, 22 June 2019 at 12:27:32 UTC, XavierAP wrote:
> should be made, buy-in. But I don't understand the benefit of 
> isolating out of the language and re-implement as libraries 
> what is already isolated and buy-in in the language.

There are several benefits, one is that you can identify missing 
pieces in the metaprogramming feature set.

Another is that it becomes easier to reimplement the language and 
thus you can get better static analysis.

A third is that you can easier analyze the language if it is 
reduced to a minimal set, so you can better understand the effect 
of extending the language.

A fourth is that you with a minimal set get the opportunity to 
add AST-manipulation (AST macros).

A fifth is that if the optimizer can work with general 
implementation strategies rather than special cases then all code 
benefits from new optimization stages.

A sixth is that there is less code to maintain, so you can get 
better structure on the compiler code base.

Or you could just view it as a low-cost experiment.


> And if I wanted that, I wouldn't start by stripping down D. I'd 
> start by extending C.

That would be a lot of work.

Besides the primary advantage of C is compatibility.

Compiling to C is worthwhile though, enables support for niche 
hardware platforms, SoC solutions etc (System on A Chip).



More information about the Digitalmars-d mailing list