Talk on what a systems programming language needs to replace C

Dibyendu Majumdar mobile at majumdar.org.uk
Tue Aug 27 19:09:56 UTC 2019


On Tuesday, 27 August 2019 at 15:54:31 UTC, Russel Winder wrote:
> On Mon, 2019-08-26 at 10:55 +0000, Dibyendu Majumdar via 
> Digitalmars-d wrote: […]
>> Personally I think neither Rust nor D can replace C.
>> C is a high level assembler. A replacement needs to be a better
>> high level assembler rather than a language that has many
>> abstractions.
>> The particular quality of C is that you can mentally see how 
>> your
>> code translates to machine code. Languages with lot of
>> scaffolding destroy this property.
>
> But isn't that at the core of problem? C is a fairly good 
> portable assembler and so there are no controls, and no support 
> for ideas such as RAII unless the programmer implements it 
> themselves. Use C and all the things such as buffer overflow 
> are programmer problems.
>

I think that a better C would simply provide / reimplement some 
aspects of C so that the programmer has better hope of catching 
certain bugs, but not take away the essential quality of C being 
a high level assembler. If D could be stripped of many of its 
features then in the better C guise it would be close. The fact 
that Better C mode is an option is not ideal IMO as D is more 
likely to be viewed in its entirety.

Rust's problem is that it has gone to an extreme position to try 
to help, but in the process simple things are no longer simple, 
and looking at Rust code is not the same as looking at C code in 
terms of transparency.




More information about the Digitalmars-d mailing list