Hacker News new | ask | show | jobs
by pjmlp 1556 days ago
This has been tried plenty of times, ARM just decided something else because reasons.

Also to note that all hardware vendors are adopting hardware memory tagging as the only way to fix C.

Intel messed up with MPX, but I definitely see they coming with an alternative, as I bet they won't like to be seen as the only vendor left without such capabilities.

1 comments

I'm honestly not sure why we haven't just admitted C isn't fixable.
Because that requires throwing away UNIX and many people feel quite strongly about it, given that it has won the data center wars.

> C Language. Dialect ISO C. ISO C source programs invoking the services of this Product Standard must be supported by the registered product.

-- http://get.posixcertified.ieee.org/docs/si-2016.html

I should also note that many attempts to add safer types to C have been tried, WG14 just doesn't care about them.

ntoskrnl.exe is C too
Not since Vista.

https://docs.microsoft.com/en-us/cpp/build/reference/kernel-...

> Creates a binary that can be executed in the Windows kernel. The code in the current project gets compiled and linked by using a simplified set of C++ language features that are specific to code that runs in kernel mode.

And then there is WIL, https://github.com/microsoft/wil

https://community.osr.com/discussion/291326/the-new-wil-libr...

> First off, let me point out that this library is used to implement large parts of the OS. There are hundreds of developers here who use it. So unlike, uh, some other things that get tossed onto github, this project is not likely to wither and die tomorrow.

> There are, however, only a handful of kernel developers working on the library, so the kernel support has been coming along much slower. I'd like to expand the existing kernel features in depth ....

can explain how the existence of a compiler flag that allows third parties to compile C++ such that it can run in kernel means that the kernel has been rewritten in C++?

the fact LLVM allows javascript to be transpiled to C doesn't mean Linux kernel has been rewritten in Javascript

Apparently someone is lacking reading skills in how WIL is used on the kernel.
Zig seems like a good replacement. It interfaces really well with C and works as a drop in replacement. Better type checking, error handling, memory management etc.