Rust Improves Tracing |
Written by Kay Ewbank |
Thursday, 31 January 2019 |
Rust 1.32 follows the release of Rust 2018 in December. The updated version adds what the developers describe as 'a few quality of life improvements', as well as switching the default allocator, and making additional functions const. Rust 2018 rolled up the improvements to the language over the past three years alongside tooling, documentation and a new website. The latest release is back to being a simple upgrade to the language. The aim of Rust is to offer a safe, fast and concurrent language without having a garbage collector. It is constructed so that problems are detected at compile time so that it can be used safely for systems programming. Rust was originally sponsored by Mozilla, and is intended for use in situations including embedding in other languages, writing programs with specific space and time requirements, and writing low-level code, like device drivers and operating systems. The improvements designed to make small things easier start with a new dbg! macro that makes it easier to print the value of a variable while debugging, so you can just write dbg! (varname) ; rather than having to write println !"{:?}", varname);. The new function also shows the name of the variable and the line number and file name that the call was made on. You can also use the value returned in expressions. The next change of note is to the memory allocator. Until now, Rust has by default used jemalloc, the original memory allocator from the time when Rust had a large, Erlang-like runtime. Jemalloc made sense at that point because it often improved performance over the default system one. However, since Rust 1.28, developers have been able to choose a global allocator, and now the default is that the system allocator is used. You can still choose to use Jemalloc if it improves the performance of your program. The other changes are more minor. The rules on the path you can use on import path statements have been relaxed so that previously invalid import path statements can be resolved; and the macro system has been improved with the introduction of a literal pattern matcher that matches matches against literals of any type; string literals, numeric literals, and char literals.
More InformationRelated ArticlesRust 2018 Released To Improve Developer Productivity Rust 1.26 Adds Existential Types Rust 1.20 Adds Associated Contents Updated Rust Improves Documentation Rust Hits Stable 1.0 - So What? 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.
Comments
or email your comment to: comments@i-programmer.info
|
Last Updated ( Thursday, 31 January 2019 ) |