Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why wouldn't you tag your 1 year old code with the compiler it was written for?

And same question for grandparents. I'm not a great dev, average at best, but at least I control my systems.



Why should you need to? Just use a stable language, or a language that has a standard or a specification.


Rust is a stable language.

Stable features will never be removed or broken. If you don't use unstable features, and aren't relying on something that is unsound, your code will continue to compile. If it doesn't, this is considered a bug and should be reported.

This isn't just a hollow promise either, they run tests against most of the crates on crates.io when making changes to the language to ensure that old code is not accidentally broken.

Claiming that rust isn't a stable language is pure misinformation, but sadly not uncommon.

It's also worth noting that some of the language is specified informally, this is the "reference", there are also RFCs for new features that describe exactly how the feature is intended to work. This isn't a complete formal specification, and could use a lot of work, but I don't think a formal specification with a committee is any better than an informal reference, assuming the reference is exhaustive!


If that's what best practices are for these languages, I now better understand my collegues who will not move away from C/C++. Having to identify a specific compiler version for each bit of code sounds like a nightmare.


C and C++ projects of any notably complexity & size often suffer from those exact same kind of "library or build tool or compiler updated—now the project won't build" problems. Absent some pretty heroic & unusual levels of discipline from all involved, anyway (which is also a way to avoid those issues in most other languages that have them).

[EDIT] Check out issue trackers for such projects, some time. "Build broke due to [thing] being too new" is a routine issue to encounter.


it's very easy. you make a file called `rust-toolchain` next to your `Cargo.toml` that contains the version of rust you intend this to compile for.

It will then compile for that version.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: