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.
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.
For developers dont know how to write if thens maybe.
Printing verbose text to standard out is still the standard when dealing with intractable APIs with bizarre error codes and improperly named methods, sequential coupling, and all the other miniature nightmares from legacy systems with no documentation or support
log = new Logger('aThing');
log.debug('I am debugging it');
log.warn('It is a warn');
log.info('I am informing you');
log.error('There is an error here');
log.critical('It is worse');
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.
Rust is a crappy language, full of unnecessary complications and a typical example of technology that humans have to serve for instead of technology that serves humans. Moreover, Rust enthusiasts tend to be pretentious fucks who think they know everything about safety and programming, but in reality are mostly C++ converts who have never programmed in Ada, Ada/Spark, OCaml, or CommonLisp. That's why they can't see that their language is such a pile of overcomplicated shit, obviously, if you come from C++ it might look like a nice alternative. Please go ahead and use Rust, I encourage everyone to do it, because that means I will finish 10 more projects than you in my language of choice while you are still trying to figure out how to program a GUI in Rust "the Rust way" - 'cos it's so much better to do it the Rust way than using OOP, even when the Rust way doesn't work for GUIs. ROTFL
called. They want their macros back.
Is a way to print the type of an expression.
Due to various reasons it's sometimes not clear what the exact type of an expression will be, so you have to give it an invalid type so the compiler will complain with the real type, and then you can copy paste that one.
Kind of annoying.
Rust is for wanna-be coders who can't write reliable, secure C.
"Awwww, did that SIGSEGV from your crappy code offend you? Poor widdle SJW.
Here, we have this dumbed-down language more suited to your limited abilities.
Think of it as affirmative action for you poor coding skills."
besides SJW's anymore? Have they cried their little eyes out on every other topic and exhausted them? Amazing little tear factories.
Did he Rust maintainers have to implement the dbg!() method, or could any Rust dev add their own? I know in Ruby I could have created my own:
def dbg!(x)
STDERR.print "#{__FILE__}:#{__LINE__} #{x.inspect}\n"
x
end
Just curious, don't know how flexible Rust is when it comes to extending the language itself.
At some point, I hope they actually manage to get the language to actually build on different operating systems correctly. Go is trivial to port.
No joke, supposedly named after a fungus.
And you know the answer is right, since it comes from Stack Overflow!
Which on the other hand references Reddit, so... hmm.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
I thought rust was a modern language. Why are we still debugging with print?
THERE WILL ALWAYS BE CONSEQUENCES FOR YOUR LIES AND PROPAGANDA NAZI FAGGOT KEN DOLL UNTIL YOU ARE BRUTALLY MURDERED
Filter error: Don't use so many caps. It's like YELLING. Filter error: Don't use so many caps. It's like YELLING. Filter error: Don't use so many caps. It's like YELLING.
No, there is an earlier "credible attempt to displace C++": D. D was created by Walter Bright, who previously was "the main developer of the first C++ compiler to translate source code directly to object code without using C as an intermediate language" (quoting Wikipedia), and so is clearly "credible" by your criteria.
The thing about Rust is that the ownership/borrowing system makes it better than C++ in important ways. Programmers have to specify variable usage details, but this (1) makes the code easier to maintain, (2) gives you a much more powerful form of RAII, (3) makes reference counting work so well that you don't need a tracing garbage collecter, and (4) makes the resulting code significantly faster in many cases. That is why Rust should compete successfully with C++, whereas a "C++ without the warts" like D could not.
I'm a nerd and interested in programming languages... And fuck anyone here who isn't
A tough nerd. Now I've seen everything.