4 ms·
This is technically true, but it was "bolted on" in an extremely non-backwards-compatible way†. Tons of APIs had to change throughout the ecosystem, which was t
by pcwalton 4y ago
This is technically true, but it was "bolted on" in an extremely non-backwards-compatible way†. Tons of APIs had to change throughout the ecosystem, which was thankfully very small at that point.
This points to what I and others mean when I say that you can't just "bolt on" Rust's borrow checking semantics to a language that doesn't have one. You technically could add the borrow checker to C++ or D or Zig or whatever, but it would break so much code that in practice the result would be a new language.
Also, a relatively minor point, but still worth mentioning: Prior to the introduction of the borrow checker, Rust didn't have any way to share memory across multiple threads, which made the migration easier as there was no need to update multithreaded code to be compatible with the borrow checker. But most languages do have shared memory, which would make adding a borrow checker to them that much harder.
† Technically it was a gradual process, starting with the introduction and slow uptake of unique pointers, then the deprecation of @ and migration to Rc/RefCell, and finally a long period of plugging soundness holes, many of those fixes causing small amounts of breakage as I recall.
- teleforce 4y agoD is now testing for borrow checker called ownership borrowing (OB): https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in-d/ https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in... https://users.rust-lang.org/t/dlang-adds-a-borrowchecker-called-the-ob-system-for-ownership-borrowing/42872 https://users.rust-lang.org/t/dlang-adds-a-borrowchecker-cal...