CVEs/LOC not a great metric
CVEs/LOC not a great metric
Posted Dec 4, 2024 1:18 UTC (Wed) by khim (subscriber, #9252)In reply to: CVEs/LOC not a great metric by Cyberax
Parent article: NonStop discussion around adding Rust to Git
> Go only guarantees that your program won't cause memory safety issues.
And then, only if there are no race conditions. Which is precisely my point: the goal of Go was never
> It's literally from the "don't do this" category.Sure, but how would I even know if I'm supposed to do that or not?
Note, that:
- Go doesn't offer any way to pass a read-only slice around (like not just C++, but even plain C could do)
- Go doesn't offer separate types for the “view slice” and “owned array” (C also conflates them, but C++ handles them separately)
- “Ideomatic” Go conflates many other different things (e.g.
setis supposed to be handled viahashmap) for the “simplicity”
Maybe, but Go's creator's behavior is unusual: it's as if they deliberately combined all the worst sides of programming language design from the last century and created something that could fight with PHP and JavaScript for the title of “the most dangerous popular memory-safe language”.
Essentially the only thing that they added to not be able to take the prize in that contest is static typing (and then pretty weak one). This, indeed, pushed them somewhat from the winning position… but other than that… all the tried and failed ideas are picked up and implemented.
If that were the language like BASIC, only designed to support newbies who couldn't grasp all the concepts that “serious languages” are using – that would have been justified… or if that was supposed to be only used for a small scripts, like Python… maybe.
But Go is not positioned like this! It pretends to be usable for large-scale projects!
And there are even some people who are using it like that…
I guess it's justified by that “strange phenomenon” that even their creators noticed: Although we expected C++ programmers to see Go as an alternative, instead most Go programmers come from languages like Python and Ruby. Very few come from C++. Also note how it took us over a year to figure out arrays and slices – which means that abomination that we are discussing here is not some sort of omission, but something that their creators are proud of! That's just simply… unbelievable.
But still… now we are conflating all languages except for C/C++ in one huge lump of “memory safe” languages – and that's simply wrong.
Not all “memory safe” languages are equally safe… but given the fact that around 70% of bugs in C/C++ programs are memory safety bugs… we should consider themselves lucky if people would switch from C/C++ to Go, JavaScript and Python… although I hope languages like Ada and Rust would good some love, too.
