2 ms·
> The module system seems clunky. There are modules, and crates, and TOML files, and module statements, and required directory structure. Adding a module seems
by tatterdemalion 10y ago
> The module system seems clunky. There are modules, and crates, and TOML files, and module statements, and required directory structure. Adding a module seems to require editing about three files. The management of imported names seems unnecessarily obtuse, too. Having both "extern" and "use" seems overkill. Most languages get by with a single "import" statement.
You have to edit two files - the new module and its parent. Crates are a separate concept from modules, and the toml file is only relevant for cargo. I do not find there are more concepts than in the module systems of other languages.
That said the Rust module system is empirically more challenging for new users than it ought to be and we'd like to improve it. "extern crate" declarations are actually unnecessary if you're using cargo and people have toyed with removing them.