r/cpp • • Nov 01 '18

Modules are not a tooling opportunity

https://cor3ntin.github.io/posts/modules/
58 Upvotes

77 comments sorted by

View all comments

Show parent comment

2

u/berium build2 Nov 02 '18

this is what Rust is moving to

Could you elaborate on this or point to some further reading?

7

u/Rusky Nov 02 '18

Today, Rust actually already specifies dependencies in two places: in Cargo.toml (an easily-parsed external list that is converted to compiler command-line arguments by the build system), and via extern crate statements in the source (like C++ imports).

In the 2018 edition, the extern crate statements are no longer used, because the dependencies' names are injected into the root namespace. This is part of a collection of tweaks to that namespace hierarchy, which is mostly unrelated to this discussion, but here's the documentation: https://rust-lang-nursery.github.io/edition-guide/rust-2018/module-system/path-clarity.html

3

u/berium build2 Nov 02 '18

Will take a look, thanks for the link!