3 ms·
I don't think there is a moral justification for circular dependency scopes to always be individual files, especially given that import statements count as circ
by howinteresting 5y ago
I don't think there is a moral justification for circular dependency scopes to always be individual files, especially given that import statements count as circular. The same issue in other languages where circular scopes are individual files leads to some horrible workarounds:
* Python TYPE_CHECKING https://adamj.eu/tech/2021/05/13/python-type-hints-how-to-fix-circular-imports/ https://adamj.eu/tech/2021/05/13/python-type-hints-how-to-fi...
* C/C++ header files
But regardless, there is too much Rust code in existence to change this now.
- yawaramin 5y agoA 'moral' justification is not needed. We are talking about potentially massive build speed improvement here. Sounds like it could just be a build setting.
- howinteresting 5y agoIt would definitely be interesting to run some experiments with automatically splitting up Rust crates into compilation units if possible.
- yawaramin 5y agoUsername checks out :-)