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.
https://doc.rust-lang.org/book/closures.html
https://doc.rust-lang.org/book/trait-objects.html
Basically, a closure is just an anonymous trait, and traits are implemented with vtables. This reminds me of how you can think of Java's lambdas as anonymous classes (though they're not implemented that way).
Ask who really needs Rust. People who write code that has to work and causes real trouble when it doesn't. That includes embedded system programmers. They're typically into C and can use an oscilloscope. They seldom know C++ and have never heard of Haskell. But they can lay out a circuit board and get it to work.
Rust needs to be accessible to those people.
You just need to know how closures work at a high level, which is pretty straightforward. Rust closures are basically the same as C++ closures.
If you're really worried about the generated code generally iterator code with closures compiles down to the same thing as the imperative code. This isn't a hidden complexity unique to Rust; C code these days is pretty far removed from the generated asm too.
An example: https://www.reddit.com/r/rust/comments/5iwyt9/how_to_accompl...
You might not need to know what "vtable" means, but the differences between, for example, `T: Fn()` and `T = Fn()` are pretty important.
Not everything can be neatly boxed in "imperative" and "functional". It's a language without purity, but with many other concepts that make a functional style work very well with it. Swift is similar. IIRC so is Scala. Depending on your POV you may classify this as functional or not; folks ascribe different meaning to the terminology here.
> Did that ".collect" generate a big intermediate array? How can you tell without looking at the generated code?
I don't understand this logic at all. How is this different from any function call in C? You don't know what that function call does without looking at the code or documentation.
This is no different from asking whether operator<< on cout allocates.
> and TOML files
This is like make/cmake/ninja files for C. Those are worse, especially since each codebase does its own thing.
> required directory structure.
no. You can set it up how you like, there's a default directory structure that's easier to use. You can redirect modules to whatever path you want using `#[path]`
> Adding a module seems to require editing about three files.
Two files.
In C you have a header and c file anyway, so the totals match up.
I agree that the module system itself is a bit confusing -- we need to get better at teaching it, but you're being rather inaccurate here overall.
I'm a fan of Rust but I also think Cargo seems pretty inelegant considering how carefully considered everything else in the language is. Maybe I'm just biased against Tom Preston-Werner.
Beyond the safety issue, I'm still not clear on how to think about Rust. It's mostly an imperative language at the language level, but it has so much functional programming stuff in templates that it looks like a functional one. It's often hard to visualize what all that stuff is doing. Did that ".collect" generate a big intermediate array? How can you tell without looking at the generated code? What kind of development environment would help?
Rust uses closures very heavily for routine functions. That's a big change in thinking for C programmers.
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.
I see all this as an acceptable price to pay for safety, but it's rough on many programmers.