3 ms·
Would Rust and it's memory safety stuff have prevented this?
by Malidir 2y ago
Would Rust and it's memory safety stuff have prevented this?
- Squeeze2664 2y agoIn some sense, yes. Use-after-free is impossible in safe Rust (if you don't use the unsafe keyword)
- xwolfi 2y agoJava too !
- bubblesnort 2y agoAnd don't forget Ada.
- Yoric 2y agoAnd OCaml or Haskell :)
- sph 2y agoWhy go fancy? Even Python saves you from use-after-free.
- Yoric 2y agoCome on, I had to outbid Ada somehow :) For what it's worth, Python was also considered at some point for use in the Firefox codebase. I don't remember the rationale for not adopting it, but I think the idea was "we all like Python, but we already have one messy language (JavaScript), let's not make it two".
- jeltz 2y agoBrainfuck too!
- yencabulator 2y agoThe difference being that no one in their right mind is thinking of rewriting a browser in Java to also make it faster, while that's exactly what Servo/Stylo etc are all about.
- wslh 2y agoIt's not as easy as everyone might think. You could take a look at this thread titled 'My big problem with Rust is too much "unsafe" code' [1]. [1] https://news.ycombinator.com/item?id=41792477 https://news.ycombinator.com/item?id=41792477
- ramon156 2y agoI'd argue that this is a good example of how rust could've prevented use-after-free, but y'know, I'd obviously be glazing.