TWiR quote of the week

Sometimes I leave ; out on purpose just to see the pretty compiler errors.

6 Likes

once you can walk barefoot (C), it’s easy to learn to walk with shoes (go) but it will take time to learn to ride a bike (rust)

/u/freakhill on Reddit

6 Likes

Nominating my own crimes against rhymes:

You better watch out
You better not cry
Better not pout
I’m telling you why
Rust is coming to town

He’s making a Vec<_>
He’s sharing it twice
Can’t modify it while the shares are alive
The borrow checker is nice

It knows when you own
It knows when you share
It knows if you’re mut
So don’t use unsafe for goodness sake!

O! You better watch out!
You better not race
Better not overflow
I’m telling you why
Rust is coming to town
Rust is coming to town

Tweet inspired by chat at work.

2 Likes

There should be a huge red warning on Rust’s package, saying it is addictive. How am I supposed to use any other language now? :innocent:

@vorner on Gitter: https://gitter.im/rust-lang/rust?at=5993fcc180d90ca0240355c5

12 Likes

#rust-internals 2014-01-17 20:13:31

<@brson> i just rejected a rust-dev post from somebody complaining about the performance of the rust game
<@acrichto> brson: haha
<@acrichto> at some point those posts will start to decline

3 Likes

This tickled me, from @frankmcsherry 's Abomination docs:

Abomonation has no safe methods. […] If you are concerned about safety, it may be best to avoid Abomonation all together. It does several things that may be undefined behavior, depending on how undefined behavior is defined.

11 Likes

These “entomb”, “embalm” and “exhume” method names are gold too :slight_smile:

Whoa. How is Abomonation better than just trying to reuse core dump data?

1 Like

No, I was just wondering, because sometimes boxing values can get a bit tiresome.

Hopefully you’re not boxing all that much in Rust :slight_smile:.

1 Like

From u/Quxxy on r/rust about rules of thumbs for use:

Do I use a specific name many times? use that name.

Do I use many things from a module, but only use them infrequently? use the module.

Do I use something only very rarely? I don’t use it, I write the full path out, or I use only within the functions it’s actually needed.

I don’t wildcard unless I’m being sloppy and writing something I don’t care about.

Whether I export a module structure or just flat symbols depends entirely on expected uses. Does the module structure matter to the user? No? pub use to create a flatter API. Does the module structure help with having lots of names? Keep it.

4 Likes

Another one from Aturon about ergonomics initiative RFCs:

13 Likes

you can ask a Future “are we there yet”, to which it can answer “yes”, “no”, or "don’t make me come back there"
an Iterator is something you can keep asking “more?” until it gets fed up and stops listening
Display is just a way to say “show me your moves”, with the other formatting traits being other dance moves
if something isn’t Send, then it’s a cursed item you can’t give away, it’s yours to deal with
if something isn’t Sync, then it won’t even appear for other people, it’s possibly an apparition inside your head
things that are Clone can reproduce asexually, but only on command. things that are Copy won’t bother waiting for you

@QuietMisdreavus on Twitter

12 Likes

<•mbrubeck> in the US and Canada we have a three-day weekend for watching rustconf videos

5 Likes

When programmers are saying that there are a lot of bicycles in code that means that it contains reimplementations of freely available libraries instead of using them

Presumably the metric for this would be bicyclomatic complexity?

— tomwhoiscontrary

11 Likes

I think it’s better to write it as “When [Russian] programmers…” for unfamiliar with the context.

1 Like

Rust did this correctly.

— /u/kpcyrd on being vulnerable to the exploit that affected Equifax

4 Likes

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

1 Like

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.

1 Like

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.

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