TWiR quote of the week


#423

From #rust-beginners:

<Xion> As usual, the cowbell method works.
<Xion> (“If you have a problem with lifetimes, the best solution is MORE LIFETIMES”)


#424

I think this quote from the “revisiting modules” post exemplifies something that I think is missing from, or at least not nearly common enough in, the C++ community:

As Quote of the Week material, I guess it’s a bit long and context-dependent. Here’s a slightly edited version:


#425

Or the extended version: “Every problem with lifetimes can be solved by adding more lifetimes, except too many lifetimes”.


#426

why<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h> would<'cntx, 'layout, 'script, 'ptr, 'context> that<'cntx, 'arena, 'static, 'sittac> be<'x, 'y, 'a, 'b, 'c, 'cntx', 'ctnx, 'i> 'a problem<'d>?


#427

< Ralith> don’t drink and unsafe D:


#428

From /r/rust:

Nah, it’s not you, it’s the borrow checker.

Honey, it’s not you, it’s &mut me.

You can borrow me, and you can change me, but you can’t own me.


#429

“Honey, it’s not you, it’s &mut me”


#430

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


#431

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


#432

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.


#433

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


#434

#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


#435

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.


#436

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


#437

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


#438

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:.


#439

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.


#440

Another one from Aturon about ergonomics initiative RFCs:


#441

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


#442

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