RFC:fused 'use mod' imports with relative paths#150
RFC:fused 'use mod' imports with relative paths#150dobkeratops wants to merge 19 commits intorust-lang:masterfrom
Conversation
|
I don’t understand this clearly at all, especially the motivation. It seems to me it makes the rules considerably more complex for no concrete benefits that I can see. Where the modules actually exist and where they are loaded is not clear to me. Can you elucidate on how this fits in with |
|
let me see if i can explain better :( Its' analogous to doing a unity build in C++ for a header-only project, with #pragma once,with a graph of includes from each header describing dependancies, 'use mod' being like #include "some/relative/path.h" and of course adding corresponding extra namespace information.
The idea is to exploit the coherence between the module heirarchy and the filesystem directory heirarchy - but imagine if you assumed that coherence, instead of relying on 'mod.rs' file to create it. If relative file paths and module paths are used, imagine if every individual file specifies its dependancies: you should be able to spider out from the root to load everything. So the idea is that "use mod" statements simultaneously load (if not already loaded) and bring into scope locally.
Its more complex alongside the existing system (think of a rolling refactor), but on its own it might be simpler? - you just see relative paths, never absolute - and you could work purely with use mod (no separate uses needed) if you wanted.
every file specifies the other files it depends on; So there is not one place its' loaded, rather the implementation would have to say "if this requested file hasn't been loaded yet, load it now." If there were no submodules within files, then just the information in 'use...' statements (if made relative) would do it.
it could replace 'mod'. More detail would be possible,e.g.
there would be no difference in how files are loaded or symbol-paths are specified between a project being divided into many crates, or compiling the entire source code as one crate. |
|
That you for taking the time to write out this RFC! We discussed this at the triage meeting today and decided to decline this. Currently |
Fix docs for Future::or_else.
`factoryFor` as a public API replacing `_lookupFactory`
No description provided.