3 ms·
> So if one finally manages to get a safer C variant that finally wins the hearts of UNIX kernels and embedded devs A safer variant wouldn't be C. What makes C
by zombieprocesses 9y ago
> So if one finally manages to get a safer C variant that finally wins the hearts of UNIX kernels and embedded devs
A safer variant wouldn't be C. What makes C great for OS development is that it is just a step above assembly and you as a developer are given tremendous amount of power to do good and evil. C#/Java are programming languages with training wheels and it's great for application development. But for low level coding required for OS, network stacks, databases, etc, you really have to take the training wheels off.
I suppose you can try and make the C type system more stringent, but then it wouldn't be C. And considering they are aiming for backwards compatibility with existing C and its immense code infrastructure, they will have to keep the "flaws" in c for all.
Time would be better spent making the libraries/kernel/etc sturdier but if they can pull it off and win the hearts and minds of OS developers, then so be it.
Also, people have been trying to sideline C for decades. Each attempt has only reinforced C's standing and reminded us why C is so essential for OS development. Anyone remember the ill-fated attempt by Sun with their JVM centered JavaOS?
- golergka 9y agoA full time C#, can confirm. It's an awesome business logic langauge, but the hot path eventually gets rewritten in a very C-like style, with all Linq, exceptions and allocations thrown out.
- xamuel 9y agoThe only way to make C safe without losing performance would be to accompany your C code with a formal proof that it avoids undefined behavior, and use a compiler which refuses to compile the code if the formal proof doesn't validate.
- saagarjha 9y agoWhich would be essentially impossible for any language like C.
- nickpsecurity 9y agoKCC is an executable, formal semantics for C that does something like that. Runtime Verification Inc uses it for their bug-hunting tools. https://github.com/kframework/c-semantics https://github.com/kframework/c-semantics http://fsl.cs.illinois.edu/pubs/ellison-rosu-2012-popl.pdf http://fsl.cs.illinois.edu/pubs/ellison-rosu-2012-popl.pdf
- pjmlp 9y agoMicrosoft already proven twice that languages with training wheels can be used for writing OSes. Google is using languages with training wheels to write core components of Fucshia (TCP/IP stack and file system tools are written in Go), as well as the new Android GPU debugger (also in Go).