Safer Linux Kernel Modules Using the D Programming Language

H. S. Teoh hsteoh at qfbox.info
Fri Jan 6 10:29:30 UTC 2023


On Fri, Jan 06, 2023 at 04:07:12AM +0000, areYouSureAboutThat via Digitalmars-d-announce wrote:
[...]
> btw. Linus one said, more or less, that one reason he likes C so much, is
> because when he is typing it, he can visualise what assembly will be
> produced (i.e. his mind is always intune with the code the machine will
> actually run).

That has stopped being true for at least a decade or more. C was
designed to map well to the PDP-11's instruction set; modern CPU's are
completely different beasts with out-of-order execution, cache
hierarchy, multi-core, multi-thread per core, expanded instruction sets,
and microcode. Why do you think, for example, that in the kernel
functions and intrinsics are used for certain CPU-specific instructions?
Because nothing in C itself corresponds to them.  The closeness of C to
the CPU is only an illusion.


T

-- 
Don't get stuck in a closet---wear yourself out.


More information about the Digitalmars-d-announce mailing list