4 ms·
>> but it's weakly typed and very unsafe Oh here we go :-) and yet the world spins on C kernels and lands jumbo jets in C autopilots and regulates heartbeats w
by CraigJPerry 4y ago
>> but it's weakly typed and very unsafe
Oh here we go :-) and yet the world spins on C kernels and lands jumbo jets in C autopilots and regulates heartbeats with C pacemakers and, and, and …
It seems there’s more nuance to this than just “strong types good”.
>> people went for C because speed was considered more important than safety
But for the past 10-27 years people have the choice to use a fast and safe language (java, c#, go) and they do, in very large numbers.
For the past 10 years (-ish) they’ve had the choice to use rust too - but they don’t. Rust has a popularity comparable to clojure or erlang.
- anthk 4y ago> fast and safe language (java, C#...) No, no even close. Java and C# crawled on a Pentium III-IV even with SSE2 compared to C and C++. If you said Ocaml...
- CraigJPerry 4y agoI started using java at 1.4, i remember Sun shouting to anyone who would listen that HotSpot could beat the gcc of the time on some 32bit integer benchmarks. IIRC it wasn't a million miles off the pace for floating point operations either.
- jfim 4y ago> Oh here we go :-) and yet the world spins on C kernels and lands jumbo jets in C autopilots and regulates heartbeats with C pacemakers and, and, and … Keep in mind that many of those things are written in a subset of the C programming language, such as MISRA C.
- CraigJPerry 4y agoAbsolutely, just as there are many ways to achieve C speed in languages like Java for particular sections of code by applying non-idiomatic optimisations, there are also many ways to improve safety beyond just types. Even things like the borrow checker has decent alternatives (tsan, msan etc.) that can be used in existing language stacks. MISRA as you point out is another useful tool in the toolbox.