TWiR quote of the week


#447

I’d recommend against having the community try and look smug in the face of this.

Agreed. The whole “Rewrite it in Rust” meme already smacks of Martin Shkreli coveting a Wu Tang CD.


#448

This is also more of a Struts problem, although Java features (reflection and dynamic class loading specifically) enable this footgun. So it’s not Rust vs Java, if that was the implication. Rust doesn’t have dynamic class loading and reflection, but someone could build a serde serializable type to do custom remote command/process execution. It would be deliberate and not some oversight though, but still possible given enough will.


#449

Doesn’t QtQuick allow dynamically instantiating any class with MOC bindings? And QtQuick is bound to Rust?


#450

Don’t know anything about QML really, so can’t comment :slight_smile:. However, whatever it has will undoubtedly be some sort of dynamic loading that Qt invented, and is not C++/Rust specific. That’s different from Java where dynamic class loading and reflection come out of the box with the language.


#451

The footgun reduction in these latest proposals is seriously impressive. Any more improvements and this won’t even feel like C anymore (in a good way!).

@Ixrec on RFC 2137 at https://github.com/rust-lang/rfcs/pull/2137#issuecomment-328956519


#452
<heycam> one of the best parts about stylo has been how much easier it has been to implement these style system optimizations that we need, because Rust
<heycam> can you imagine if we needed to implement this all in C++ in the timeframe we have
<bholley> heycam: yeah srsly
<bholley> heycam: it's so rare that we get fuzz bugs in rust code
<bholley> heycam: considering all the complex stuff we're doing
* heycam remembers getting a bunch of fuzzer bugs from all kinds of style system stuff in gecko
<bholley> heycam: think about how much time we could save if each one of those annoying compiler errors today was swapped for a fuzz bug tomorrow :-)
<njn> you guys sound like an ad for Rust

Conversation from #servo between some long-time Firefox developers.


#453

@Havvy in #rust-offtopic:

<Havvy> unsafe impl !Send for MyType // Don't thread on me

#454

“The compiler is grumpy for you so you don’t have to be” – Élisabeth Henry @RustFest Zürich


#455
<pnkfelix> what is our formatting style for a boolean `a && b && c` where I need to break the line in the middle? 
<pnkfelix> in particular, do I do the break after one of the `&&`, or before it?
<WindowsBunny> pnkfelix: I personally put && after the newline, but I'm also apparently several standard deviations away from normal
<pnkfelix> WindowsBunny: clearly the answer is to support breaking the line between `&` and `&`; that would make everyone happy, right? ;)

https://botbot.me/mozilla/rust-internals/2017-10-11/?msg=92169028&page=2


#456

Rust is like English, just with more turbofish.

Xion_ on the #rust irc channel. (https://botbot.me/mozilla/rust/2017-10-19/?msg=92498115&page=13)


#457

from #rust-offtopic:

 <kiwi> So how did Rust's borrow checker get invented and was it there since the very beginning?
 <kiwi> Because it's a really good idea
 <panicbit> We just unsafely borrowed it from the future

#458

And that is actually supported :open_mouth: https://play.rust-lang.org/?gist=23ebc666f4ab8b7b2ce9a2fcdf4abf13&version=stable


#459

Clippy catches it:

warning: taken reference of right operand
  --> src/main.rs:14:5
   |
14 |     a() & & b();
   |     ^^^^^^-----
   |           |
   |           help: use the right value directly: `b()`

#460

From this AMA :

I guess I would say that, it’s not only important that it be possible to do a good design in a given language, but that the language actively encourage it by making the bad design painful. I think rust does a FANTASTIC job of this.


#461

#rust:

<m4b> i’m writing generic code so generic right now i don’t know how its working, but it does

Referring to this code.


#462

https://github.com/rust-lang/rust/pull/45501#issuecomment-340159627:

assume is dark magic of the higher schools, so I’m not surprised there are sparks. I think it’s best to not use it unless absolutely necessary.

@bluss


#463

Is something wrong with me if that description actually made me want to look up this assume thing? :stuck_out_tongue:


#464

On #rust-internals wrt. https://github.com/rust-lang/rust/pull/45527

durka42 IMO the name “dangling” is scary enough :slight_smile:
Havvy gives durka42 a ptr::dangling::<Candy>().
durka42 declines to unwrap() it

https://botbot.me/mozilla/rust-internals/2017-11-02/?msg=93047552&page=2


#465

A brilliant observation by @kickass_turing on reddit about Rust code being refactoring friendly:

Also the way I see it is that Rust makes problems local.


#466

Another nice example of the “lisp effect”, where learning one language makes you better in another :slight_smile: