Posted Mar 13, 2013 13:54 UTC (Wed) by mathstuf (subscriber, #69389)
Oh, no! Let's rewrite the kernel then. C certainly isn't "memory-safe". At least C++ has smart pointers, but since we're starting from scratch, let's write it in Haskell.
But if that's your argument, I argue that any application written in Java probably shouldn't be network-facing these days either…
Posted Mar 13, 2013 17:03 UTC (Wed) by Cyberax (✭ supporter ✭, #52523)
Of course, right now it's not (yet) feasible because of the sheer size and complexity of Linux.
Posted Mar 16, 2013 1:10 UTC (Sat) by HelloWorld (guest, #56129)
Posted Mar 13, 2013 17:33 UTC (Wed) by codewiz (subscriber, #63050)
> Using a language that isn't memory-safe for an application that will
> face the internet is madness.
Modern C++ programming style isn't as prone to buffer overruns as old-school C was. Containers manage their own memory and expose a relatively safe API. Over the years, C++ has become quite a safe AND efficient language, albeit very hard to learn.
With the advent of smart pointers and RAII, you rarely need to explicitly free memory or close a file. In fact, the worse resource leaks I've seen in the last few years came from dangling references and missing close() calls in dynamic languages.
Posted Mar 16, 2013 0:58 UTC (Sat) by HelloWorld (guest, #56129)
I'd still much rather write an application in C++ than in C, simply because it's so much more expressive. But it's not really any safer. Unless I have very high performance requirements, I'll avoid C++ if at all possible (and C even more so).
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds