r.e. rust’s use of both Absolute and Relative paths. (use is absolute, whilst in code its relative?)
I gather there was a suggestion to make code ‘try relative, then if not found try absolute’
Imagine if this was generalised,
e.g. given
qux/foo.rs fn something()
qux/bar.rs
if you write foo::something() in ‘bar.rs’, it would look for these, in order:-
[1] ::qux::bar::foo::something() i.e self::<path>[2] ::qux::foo::something() i.e. super::<path>[3] ::foo::something() i.e super::super::<path>etc
i.e. … “let x=current path; do { if x::(given path) exists, return it, else pop last element from x and try again} while (x)”
Prohibit absolute paths in code, they are rarely (?) used anyway.
Then use declarations will become the only “points of import” for a module and will create an easily extractable dependency graph for modules, which will facilitate partial recompilation.