5 ms·
I'm surprised ADA isn't on the list since it is memory safe in modern versions (like rust you can turn that off, though it isn't as obvious as unsafe when you d
by bluGill 4y ago
I'm surprised ADA isn't on the list since it is memory safe in modern versions (like rust you can turn that off, though it isn't as obvious as unsafe when you do). Even modern C++ is reasonably memory safe, but someone needs to rewrite the old code you interface with to get that.
- couchand 4y agoYou can't "turn off" memory safety in Rust, that's an absolutely misleading way to describe unsafe.
- pencilguin 4y agoDo you prefer "opt out"?
- Filligree 4y agoI suppose the point GP is trying to make is that unsafe blocks don't really change the pre-existing safeties, it 'just' lets you also do things which are unsafe, but which have different syntax. Already-safe code remains safe if you wrap it with unsafe. The implications to a code reviewer don't change much from that, however.
- pencilguin 4y agoWhat is being turned off is not safety itself, but automatic enforcement of rules. If course no one wants to ship actually unsafe code, and it is very rare to do it in Rust or modern C++ programs. But it is depressingly common in C programs and mostly-old programs like Chromium, and in the C libraries that programs of all kinds still depend on.
- Jtsummers 4y agoAda, no need to shout its name. But even Ada 83 had a lot of safety features that made it worthwhile, it just didn't take off (for a variety of reasons including anger from developers "how dare they tell us what to use" and cost "you want how much for a compiler and we have to get a new license for a new project?!?"). Its arrays carried their size and range with them so you could safely iterate over them and safely (well, you'd get a runtime error at least versus C's "I trust you" model) access their elements. You had tasks and rendezvous since Ada 83 which could be used to protect access to data across other tasks (this was improved later with protected types in Ada 95). You could tightly control, in the language not at runtime, the memory layout of records which was useful for over-the-wire protocols. With C you couldn't guarantee a particular packing for a struct would be uniform across compilers, with Ada you could. This also helps reduce bugs because you can apply DRY properly, in C you have to implement marshaling and unmarshaling yourself, in Ada it was just a given. It's a very underrated language, mostly discounted because, it turns out, people are more into fashion and style than substance. "Eww, it uses keywords like `begin` and `procedure`" seems to be the #1 reason for rejecting it anymore, rather than any serious analysis.
- pencilguin 4y agoThere is no language named ADA. Never was, unlike (say) FORTRAN or COBOL.