Why static analysis is the way to go

H. S. Teoh hsteoh at qfbox.info
Thu May 28 19:41:27 UTC 2026


Preaching to the choir here, but this again shows why static analysis
and compiler-enforced checks at compile-time is the way to go:

https://www.zdnet.com/article/rust-will-save-linux-from-ai-says-greg-kroah-hartman/

The Linux kernel is a pretty large C codebase, and I also work with a
pretty large C codebase in my day job.  At that scale, the weaknesses of
C persistently come up: forgetting to free a pointer after use,
forgetting to release a resource (often in a rare path not often or
never tested), buffer overruns, dangling pointers, etc..  After decades
of working on a large complex C codebase, I've grown weary of debugging
these same old problems over, and over, and over again.

D made a lot of right choices in this area: statically-verifiable const,
compiler-enforced nothrow, pure, etc., arrays that always carry length
and out-of-bounds deference causing a runtime exception instead of
overwriting arbitrary memory, GC eliminating an entire class of pointer
bugs, etc..  These make D a huge pleasure to work with, as opposed to
the constant stream of pointer bugs, memory leaks, and
programming-by-convention that has been proven to be ineffective decades
ago, that you have to put up with when working in C.


T

-- 
What starts with O and ends with NIONS and sometimes makes you cry?  Opinions.


More information about the Digitalmars-d mailing list