4 ms·
> Only outside unsafe blocks. This is a relatively uninteresting quibble: the guarantees of any language only apply outside their equivalent of unsafe blocks (
by dbaupp 10y ago
> Only outside unsafe blocks.
This is a relatively uninteresting quibble: the guarantees of any language only apply outside their equivalent of unsafe blocks (e.g. Python is memory safe... until you use ctypes). Pretty much everything has a way to FFI down to interact with the machine; in Rust, it's just called `unsafe`.
(One way to look at `unsafe` is that it's a tightly integrated FFI to another language called "unsafe Rust", and it benefits from having zero performance or semantic overhead.)
- p0nce 10y agoPython doesn't market itself by telling it's memory-safe https://www.python.org/ https://www.python.org/ If a language frontpage is inexact I'll assume the rest of the website is inexact, simple as that.
- Manishearth 10y agoHis point is that in the world of programming languages, "true memory safety" isn't really something achievable without making it impossible for your language to interact with things like native libraries or the OS. Given this, the concept of "true memory safety" isn't a useful one. In general when you say a language is memory safe, there's an implicit caveat that there may be explicit escape hatches. No language (except perhaps web-based JS) is "memory safe" by the strict definition so it's not a useful parameter to use when talking of languages. You instead use the weaker version. Terminology matters.
- kibwen 10y agoCan't tell if trolling or not. Python doesn't market itself as memory-safe because it's completely expected that scripting languages are memory-safe. The only domain where memory safety isn't taken as given is in systems programming, which is why Rust's safety guarantees are a big selling point.
- p0nce 10y agoNot trolling. I'm just trying to convey a simple point. https://news.ycombinator.com/item?id=13378183 https://news.ycombinator.com/item?id=13378183 As it cost me 20+ downvotes to make a rational conversation with you all, I will stop interacting with the Rust community.