4 ms·
Python can be simple, to the degree it is simple, because it makes so many of your decisions for you. In Rust the design space is very large. For instance, if
by mikebenfield 4y ago
Python can be simple, to the degree it is simple, because it makes so many of your decisions for you.
In Rust the design space is very large. For instance, if your new type is going to refer to some data, should it own the data, should the data be on the heap (in a box), should it carry a safe reference (if so, mutable or not?), should the data be reference counted, or possibly atomic reference counted, or maybe for some reason you need to keep an unsafe raw pointer to the data?
In Python this is simple because the decision is already made for you: your new type keeps (essentially) a reference counted ref to the data it needs. That’s it. That’s all you can do.
That’s great if that decision is always adequate for your application. If you need extra flexibility you’ve got a problem.