Rust 1.23 Uses Less Memory
Written by Kay Ewbank   
Thursday, 11 January 2018

There's a new version of Rust that uses less memory and no longer makes unnecessary copies.  The documentation has also been changed to use CommonMark.

Rust was originally sponsored by Mozilla, and is designed to be safe, fast and concurrent without having a garbage collector. It uses innovative means to make system programming safe by the language being constructed in such a way that problems can be detected at compile time. Intended uses include embedding in other languages, writing programs with specific space and time requirements, and writing low-level code, like device drivers and operating systems. 

The changes to this latest version start with the avoiding of making unnecessary copies of arguments that are simple bindings. The problem arose because in the past MIR (Rust's Mid-level Intermediate Representation of a program) differentiated between arguments and locals. This meant there was a need to add extra copies assigning the argument to a local, even for simple bindings. MIR has been changed so it no longer differentiates, but until now the copies have continued to be created, bloating the MIR and LLVM IR that the compiler emits. This has now been corrected.

This has resulted in a five to ten per cent drop in memory usage in the tests run by the developers, though they say your mileage may vary.

The other main change to this release is that rustdoc has been moved to use CommonMark. Until now, rustdoc never guaranteed which markdown rendering engine it used, but the developers have now committed to using CommonMark. The change isn't complete yet as the documentation in this release is being rendered with the previous renderer, Hoedown, as well as with a CommonMark compliant renderer.

This release also sees the addition of some new stabilized APIs:

  • The various std::sync::atomic types now implement From their non-atomic types. For example, let x = AtomicBool::from(true);.
  • () now implements FromIterator<()>;
  • RwLock<T> has had its Send restriction lifted

rust

 

More Information

Rust Website

Related Articles

 Rust 1.20 Adds Associated Contents

Rust 1.16

Updated Rust Improves Documentation

Rust 1.6 Released

Rust 1.3 Released

Rust Releases New Versions

Rust Hits Stable 1.0 - So What?

Rust 1.0 Alpha Released       

Rust Reaches 0.9

Rust 0.7 Released

Rust 0.4 Full Integration of Borrowed Pointers

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

 

Banner


JetBrains Makes WebStorm and Rider Free for Non-Commercial Use
24/10/2024

JetBrains has launched a non-commercial license for its JavaScript and TypeScript IDE, WebStorm, and for Rider, its cross-platform .NET and game development IDE.



AI Propels Python To Top Language on GitHub
30/10/2024

This year's Octoverse Report reveals how AI is expanding on GitHub and that Python has now overtaken JavaScript as the most popular language on GitHub. The use of Jupyter Notebooks has also surged.


More News

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info