News for hackers. Stuff that matters.
Re:Rust 1.0: Scheduling the trains by steveklabnik on Friday December 12, 2014 @11:32AM (#8740982)
I'm... not sure what you mean by this. Something like #include technically exists, but is absolutely not used everywhere, and is certainly not the 'default build system'.[1]

Where was this discussion held?

1: http://doc.rust-lang.org/std/macro.include_str!.html is what I'm thinking of here.

Re:Rust 1.0: Scheduling the trains by Sir_Cmpwn on Friday December 12, 2014 @11:36AM (#8741007)
"Functionally equivalent" to, not identical to. I'm talking about the module system. You could literally replace any instance of:

    mod mod_name;
With:

    #include "path/to/mod_name"
and then run it through the C preprocessor and it'd work exactly the same.

The discussion was held on IRC.

Re:Rust 1.0: Scheduling the trains by steveklabnik on Friday December 12, 2014 @11:37AM (#8741022)
This is absolutely not true. Rust has no textual substitution like the C preprocessor does, and includes a module system, which has namespacing.
Re:Rust 1.0: Scheduling the trains by Sir_Cmpwn on Friday December 12, 2014 @11:48AM (#8741111)
I put together a small demonstration for you:

https://github.com/SirCmpwn/rust-poc

Re:Rust 1.0: Scheduling the trains by steveklabnik on Friday December 12, 2014 @11:52AM (#8741138)
That is one, very, very tiny aspect of the C preprocessor.

And https://github.com/SirCmpwn/rust-poc/blob/master/includes.rs... is significant: the code included from another file is under a namespace, and isn't going to clash like randomly throwing #includes around will, and you don't need to worry about things like double inclusion...

In other words, I think this is a very superficial comparison, and I'm not even sure why it upsets you so. Rust won't be a perfect language for everyone, and that's okay.

Re:Rust 1.0: Scheduling the trains by Sir_Cmpwn on Friday December 12, 2014 @11:53AM (#8741149)
Well, you could move the mod { } to the included file to accomplish the same result (like the `namespace` keyword in C#), but that'd break the example I'm trying to give. I don't really want to rehash this argument on Hacker News, I'm just providing context. There are numerous flaws in the module system that derive from this basic point.
Re:Rust 1.0: Scheduling the trains by phaylon on Friday December 12, 2014 @11:54AM (#8741156)
I'm not really a C guy, but isn't #include about using a module in the current scope? Because Rust's mod is for project structure definition.
Re:Rust 1.0: Scheduling the trains by dbaupp on Friday December 12, 2014 @07:26PM (#8743518)
#include in C is just textual substitution of the contents of the specified file in place of the #include statement, there is not a concept of namespace in C.
Re:Rust 1.0: Scheduling the trains by Sir_Cmpwn on Friday December 12, 2014 @11:59AM (#8741195)
I can't really effectively explain how all of this works without providing a lot of background on systems languages in general, especially background on how linking works. Sorry.