Slashdot Mirror


Rust 1.31 Released As 'Rust 2018' In Major Push For Backwards Compatibility (rust-lang.org)

"The Rust programming language team has announced the first major edition of Rust since 1.0 was released in 2015," reports SD Times -- specifically, Rust 1.31, the first edition of "Rust 2018," described by Rust's developers as "the culmination of feature stabilization."

An anonymous reader writes: The Rust team is working hard to maintain backwards compatibility, for example with the way they're handling the ongoing addition of an async/await feature. "Even though the feature hasn't landed yet, the keywords are now reserved," notes the Rust Team. "All of the breaking changes needed for the next three years of development (like adding new keywords) are being made in one go, in Rust 1.31." The keyword "try" has now also been reserved, but "Almost all of the new features are 100% compatible with Rust as it is. They don't require any breaking changes... New versions of the compiler will continue to support "Rust 2015 mode", which is what you get by default... [Y]ou could think of Rust 2018 as the specifier in Cargo.toml that you use to enable the handful of features that require breaking changes."

The Rust language's blog adds, "Your 2018 project can use 2015 dependencies, and a 2015 project can use 2018 dependencies. This ensures that we don't split the ecosystem, and all of these new things are opt-in, preserving compatibility for existing code. Furthermore, when you do choose to migrate Rust 2015 code to Rust 2018, the changes can be made automatically, via cargo fix." Tooling improvements include faster and smarter "incremental" compilation (along with better IDE support), plus the addition of function-like and attribute-like (procedural) macros. There's also a rustfmt tool which can automatically reformat your code's style "like clang format does for C++ and Prettier does for JavaScript," plus an optional diagnostics linter named clippy, and automated code fixes via rustfix. There's even upgrades to Rust's module system and other path clarity improvements.

But this is only the beginning, SD Times reports: With the release of Rust 2018, the team is now starting to look at Rust's future. The team is asking developers to reflect on what they liked, didn't like or hoped to see in Rust during the last year, and propose any goals or directions for the upcoming year.

1 of 81 comments (clear)

  1. Why I love Rust by dremon · · Score: 3, Informative
    I've been lucky to persuade our PM to give Rust a try. Our main server product is written in Scala and now it also includes several Rust components which I develop and maintain. What a difference it makes! As a pro developer with decades of experience in Java/C/C++ I fully embrace it.

    Learning curve is quite steep, yes, due to unusual concepts (mainly borrow checker and move semantics). Once you get past struggling with that everything clicks in it's place and coding becomes fun again, way more so than in C/C++.

    My bullet points why I like it so much:
    • Great compiler/tooling design, cargo build tool, rustup compiler management, crates.io central repository
    • Amazing built-in unit test support, it's SO easy to write unit tests next to your production code and they are not included into the production build!
    • Very modern language features: traits, higher-order functions, closures, iterators, generics, threads, very good standard library, great external asynchronous modules which are being added now to stdlib
    • It's hard to make a messy design with sea of objects, compiler kind of enforces you to think over relations
    • No data inheritance
    • Great module system, which just became even better with 2018 edition
    • Safety, safety, safety. It's next to impossible to shoot yourself in the leg unless you do unsafe code (which is normally localized to few source locations for few special cases)
    • Fast growing collection of crates (modules), I think the intrinsic safety of the language makes them in general more stable than 3rd-party stuff written for example in Java
    • Semantic versioning, no jar hell
    • Consistent tooling, no freakin' sea of hundred build tools (cmake/make/nmake/meson/autotools/msbuild/whatever_stuff_of_the_day) and no manually managed external dependencies
    • Working IDE support, although not as polished as for Java, the IntelliJ and VSCode/RLS are working ok, especially IntelliJ
    • Very easy to integrate with existing C/C++ code via FFI, which is one of the design goals
    • No runtime and no dependencies for the target executable
    • No garbage collection, fine control over heap/stack allocations, runs blazingly fast
    • Easy to do cross compilation
    • Based on LLVM, supports all major targets