Slashdot Mirror


Rust 1.32.0 Stable Release Includes New Debugging Macro, 'Quality of Life' Improvements (rust-lang.org)

An anonymous reader summarizes the changes in Thursday's release of Rust 1.32.0 stable: "Quality of life" improvements include a new dbg macro to easily print values for debugging without having to use a println statement. For example, dbg!(x); prints the filename and line number, as well as the variable's name and value, to stderr (rather than to standard output). Making it even more useful, the macro also returns the value of what it's debugging -- even all the boolean values returned by each execution of an if-then statement.

Rust macros can now match literals of any type (string, numeric, char) -- and the 2018 edition of Rust also allows ? for matching zero or one repetitions of a pattern.

In addition, all integral numeric primitives now provide conversion functions to and from byte-arrays with specified endianness.

2 of 96 comments (clear)

  1. Why Rust by 110010001000 · · Score: 3, Interesting

    Why did they call a language "Rust"? Did they think that was descriptive, or cute, or what? Is it an acronym? I understand things like "Swift" and "Go", but "Rust"doesn't make any sense.

  2. Re: Quality of life by swillden · · Score: 3, Interesting

    Your first error was in assuming C++ is replaceable. You can stop using C++ and use something else because C++ is good at one thing and better than anything else at that one thing. Don't want C++? Choose the best choice. You don't use a language to replace another language. You use a language because its what you want.

    Nonsense.

    For any given context, there is no single perfect language. There are always different options, with various pros and cons. And as the options and the context both change over time, it often does begin to make sense to replace one language with another. The value of the new language has to be very significant to justify rewriting working code, though.

    --
    Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.