3 ms·
I'm not sure that this question even makes sense. It's like asking: "What language features are needed in order to implement a borrow checker?" You don't bolt
by krapht 6y ago
I'm not sure that this question even makes sense. It's like asking: "What language features are needed in order to implement a borrow checker?"
You don't bolt this functionality on to an existing language; it requires changes to your whole compiler pipeline to be useful.
- drcode 6y agoDon't be so certain, some languages allow a lot of flexibility within libraries. For instance, Clojure has an excellent library implementing Go-style channels with green threads (core.async) all built without any modifications to the core system.
- krapht 6y agoSure. Linear types and borrow checking is possible in Lisp too, but I wouldn't take that as evidence that it's super easy to make Clojure behave like Rust. What is possible and what is practical are two different things.
- zelphirkalt 6y agoGood point, Lispy languages with sufficiently powerful macro systems can do this. This is part of the reason, why no language committee deciding on backwards compatible changes to the language is needed to develop such a library. I don't know enough to say whether this would be possible in Rust.