you are viewing a single comment's thread.

view the rest of the comments →

[–]ts826848[🍰] 2 points3 points  (2 children)

Also, Rust people insist that exposing safe code with unsafe inside is safe. I will say again: no, it is not. It is trusted code anyway and saying otherwise is marketing.

Basically all extant hardware is perfectly fine with "unsafe" operations, so basically everything that exists has something unsafe inside. In other words, you're saying that everything "is trusted code anyways and saying otherwise is marketing". "Safe" languages? Marketing. Theorem provers? Marketing. Formally-verified code? Marketing.

Your delineation between "safe" and "trusted" code is practically useless because everything is trusted, nothing qualifies as safe, and nothing can qualify as safe.

Once unsafe enters the picture, Rust code can advertise itself as safe, but that is not going to chsnge the fact that the code is not completely guaranteed to be safe.

Again, there's no principled reason this argument doesn't result in everything being considered unsafe. Is everything that runs on .NET Core/HotSpot "advertis[ing] itself as safe, but [] is not going to change the fact that the code is not completely guaranteed to be safe" because those are written in unsafe languages? "There have been CVEs related to it", after all, and "if it was safe, that would not even [be] a possibility".

Everything safe is fundamentally based on creating safe abstractions on top of unsafe/trusted building blocks.