Bjarne Stroustrup’s Plan for Bringing Safety to C++ (The New Stack)
Bjarne Stroustrup’s Plan for Bringing Safety to C++ (The New Stack)
Posted Nov 7, 2023 10:24 UTC (Tue) by mb (subscriber, #50428)In reply to: Bjarne Stroustrup’s Plan for Bringing Safety to C++ (The New Stack) by vadim
Parent article: Bjarne Stroustrup’s Plan for Bringing Safety to C++ (The New Stack)
So we're back to: You must specify -O0, if you "program to the hardware".
Posted Nov 7, 2023 19:12 UTC (Tue)
by vadim (subscriber, #35271)
[Link] (2 responses)
So if you're counting cycles you should probably be actually coding it in assembler.
Posted Nov 7, 2023 19:17 UTC (Tue)
by mb (subscriber, #50428)
[Link] (1 responses)
Posted Nov 8, 2023 13:16 UTC (Wed)
by vadim (subscriber, #35271)
[Link]
Eg, under DOS you can write C code that sets interrupt handlers, or does low level control of the floppy drive. The ability to do such low level things is precisely why C gets used to write operating systems.
Like I said elsewhere, "portable assembler" is in my view a very metaphorical description, because obviously there can't be such a thing in the absolute sense. Proper assembler reflects the CPU's architecture, and a single language can't accurately depict the wildly different designs that exist. However it can get there part of the way given some compromises.
Bjarne Stroustrup’s Plan for Bringing Safety to C++ (The New Stack)
Bjarne Stroustrup’s Plan for Bringing Safety to C++ (The New Stack)
I fully agree.
Bjarne Stroustrup’s Plan for Bringing Safety to C++ (The New Stack)