A Case for Oxidation: A potential missed opportunity for D

Jacob Carlborg doob at me.com
Fri Jun 29 19:17:21 UTC 2018


On 2018-06-29 12:55, kinke wrote:

> I'd love to hear some reasons for -betterC from a competent guy like
> yourself. I simply don't get what all the fuzz is about and what people
> expect to gain from losing druntime (and language features depending on
> it) and non-template-only Phobos. I understand the separate 'minimal
> runtime' need for bare metal (no Type- and ModuleInfos etc.), but I
> can't help myself in seeing betterC as, nicely put, worseD. I
> acknowledge that it seems to attract wide-spread interest, and I'd like
> to understand why.

You can potentially do a lot at compile time (which you cannot do in C 
or C++) while at the same time have a requirement of not using a 
runtime. There's a talk, I think at a Dconf, where the speaker was using 
D on bare metal. He used CTFE to parse a PDF file with the specification 
for op codes or something similar. The CTFE code generate some table or 
other code for the op codes. This resulted in the code always being up 
to date with the specification.

I've written a tiny plugin for an application where I used a tiny part 
of the D runtime. I didn't link with it but instead inlined the 
functions I needed directly in the plugin. For example, array copying.

There are several nice features that can be used without the runtime, like:

* Strings and arrays carry their length
* foreach
* Array slicing
* Compile time features


-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list