Safer Linux Kernel Modules Using the D Programming Language

Walter Bright newshound2 at digitalmars.com
Mon Jan 9 03:54:32 UTC 2023


On 1/7/2023 2:25 PM, areYouSureAboutThat wrote:
> In fact, C can be used in a perfectly memory safe manner.

Yes, as long as you don't make any mistakes. A table saw won't cut your fingers 
off if you never make a mistake, too.


> The problem is that too few programmers know how to do that, and even very 
> experienced C programmers can get it wrong sometimes. Both tools and compilers 
> have come along way over the last decade, and it's getting increasingly 'harder' 
> to write memory unsafe C, but in the end, in C, its the programmer that has the 
> control.

Buffer overflows are trivial to have in C, and C has no mechanism to prevent 
them. Buffer overflows are consistently the #1 security problem with production 
C code.


> But C will always be the language that gives the programmer the flexibilty and 
> control needed, when all the other languages will not.

There's nothing you can do in C that you cannot express in D, with the same code 
being generated.

Even bitfields!


> To be 'C like', the language needs to provide the same flexibility and control 
> as C, and map to the hardware and its instructions set as well as C. In other 
> words, it's going to end up being C anyway.

Or DasBetterC!



More information about the Digitalmars-d-announce mailing list