These are chat archives for rust-lang/rust

11th
May 2017
Thomas Schaller
@torkleyy
May 11 2017 04:29 UTC
Yes, you did. Thank you!
Joonas Koivunen
@koivunej
May 11 2017 07:05 UTC
it'd appear that when testing, there is a panic handler that somehow stops all threads when a single assertion fails in any thread. am I reading this correctly?
Joonas Koivunen
@koivunej
May 11 2017 07:29 UTC
actually no, it does not do that. it just appears that way because my "witness" thread panics and closes mpsc::Receiver which in turn shuts down all the other threads
Fra ns
@snarf95_twitter
May 11 2017 19:46 UTC
what is with macros in rust? it seems almost like magic.
Joonas Koivunen
@koivunej
May 11 2017 19:52 UTC
@snarf95_twitter since the custom derives have been possible I haven't had to write any more macros (did do some From implementation generating macros, replaced with awesome derive_more) crate
Fra ns
@snarf95_twitter
May 11 2017 19:56 UTC
my question is why does rust even have macros
Christian Howe
@cjhowe7
May 11 2017 20:03 UTC
macro are love macros are life
Sean Leffler
@sdleffler
May 11 2017 20:04 UTC
@snarf95_twitter they're really useful for eliminating massive amounts of boilerplate
Also you can do fun things
Fra ns
@snarf95_twitter
May 11 2017 20:13 UTC
but they also make code difficult to read and maintain...
Sean Leffler
@sdleffler
May 11 2017 20:13 UTC
Only if you don't document your macros.
They also eliminate human error in implementing boilerplate
I have much more confidence in a macro's implementation of a boilerplate trait than my own
Fra ns
@snarf95_twitter
May 11 2017 20:15 UTC
it's just that in c++ macros are looked down upon
Sean Leffler
@sdleffler
May 11 2017 20:15 UTC
Well, C++ macros are nonhygienic
A totally different beast from Rust macros
Rust macros are safer and easier to work with
Fra ns
@snarf95_twitter
May 11 2017 20:16 UTC
maybe it's just the word macro that is making me not love it
bigDaddyS1oth
@bigDaddyS1oth
May 11 2017 20:19 UTC
If anyone needs practice with Rust, I suggest going to think link: http://exercism.io/languages/rust/about
Fra ns
@snarf95_twitter
May 11 2017 20:24 UTC
That's pretty cool
bigDaddyS1oth
@bigDaddyS1oth
May 11 2017 20:26 UTC
Yea pretty decent resource that's free
Sean Leffler
@sdleffler
May 11 2017 21:19 UTC
@snarf95_twitter How I Learned To Stop Worrying and Love the Macro
:P
...well, that was by abusing Rust macros to their limits.
:shipit: