Hacker News new | ask | show | jobs
by MaxBarraclough 1606 days ago
You're right of course that hardware has improved immensely, but I'm not sure what your point was. There are plenty of domains where performance is still of great importance, and C still has excellent performance.

I think the real point is that modern languages can significantly improve on the major issues with C, particularly its undefined behaviour and how that translates to real-world security issues, without significantly impacting performance. Rust (and in particular its Safe Rust subset) has been competing more with C++ than with C, but the point is still there.

I admit though that I don't have hard numbers on what would be the performance cost of writing an OS (for example) in Rust rather than C.

1 comments

Zig is apparently not much more complicated than C. It's got the same focus on low-level programming and manual memory management as C does. Doesn't support operator overloading though, and probably never will. :(
I didn't mention Zig because as far as I know there's no Safe Zig subset, nor are there plans to develop one. Zig itself is an unsafe language. [0][1]

That's the nice thing about Safe Rust, it's a proper safe language akin to Java and JavaScript, while retaining high performance, plain old ahead-of-time compilation, and no garbage collector. Zig isn't playing the same game.

[0] https://www.scattered-thoughts.net/writing/how-safe-is-zig/

[1] https://news.ycombinator.com/item?id=26537693