# TWiR quote of the week

Some time later the tax man comes by. He asks to see my tally sticks from last year. Oops, now I have a problem! I need records, databases, immutable data structures, extra book keeping work. Incidental complexity.

What am I missing in my shepherds tale?

Your analogy is quite good, but I don't think it unambiguously supports mutable data structures.

The abacus will let you count faster, but is a bad medium for long-term storage. A stick with notches isn't exactly immutable, since you can cross over notches, so in a sense they're mutable but only additively. If you glue the beads of the abacus it becomes better than a stick with notches for bookkeeping but worse for counting.

You can evaluate data structures outside of computers perfectly fine like this. I would even say that this isn't figurative speech or metaphor: We're actually analysing the time and space complexity of real-world data structures. Once we get to von Neumann-style computers, the materials (RAM, CPU, etc.) just have a different cost profile which make some analogical comparisons break down a little.

A very strong property of immutable data is that you can refer to it from other data and know that it won't eventually become invalid. So immutable data can be used to annotate other immutable data (or other mutable data, for that sake, but then this recursive property is instantly lost). This is the bookkeeping part.

The radical idea of using functional or otherwise declarative programming for general purposes (rather than very domain-specific ones) comes from the observation that often the cost of immutable data structures is well within acceptable limits of our materials. And because computer programs often do a mixture between counting and bookkeeping, you get the benefits of persistency at more levels.

When the cost of immutability is too high, Haskell has come up with the ST monad, which is a type-safe way to mutate a value locally. When the cost of mutability is too high, Rust has come up with borrowed types. These notions may essentially express the same machine-level operations.

Whether you decide to complicate your program with "pure data" or "linear types", the justification is in both cases that more constraints will provide for more efficient compilation and execution strategies, at the cost of mental overhead to the programmer. So if you think e.g. linear types are worth pursuing, you're probably closer in mindset to a purely functional programmer than you think, sans the extremist attitude.

2 Likes

So, Rc<RefCell<T>> is "Shut up, I don't care", while unsafe is "Shut up, I know what I'm doing"?

5 Likes

I wouldn't say that.

Sometimes it really is the right tool for the job, but it often gets abused by people used to having a GC where it's okay to hand out references like candy.

unsafe on the other hand can be thought of as the pragmatic escape hatch you sometimes need to use when doing things which are, well, unsafe... That doesn't roll off the tongue nearly as nicely as you put it though...

3 Likes

most of the quotes in this thread are very positive and sometimes funny, but looking at the original post from feburary 2015 above, we're supposed to also submit "insightful" stuff. so i guess the following one qualifies, even though it's kind of sad.

The number of crates which can be charitably described as a " barely functional list of the author's opinions wrapped around a project's c-api " is mind numbing. Picking a crate for a new problem domain is like walking through a mine-field. It feels like (when official options are not available) I need to dedicated ~3-4 weeks to just selecting and patching the dependencies I'm going to use for a project so I can be responsibly confident in them.

-- valarauca14 on reddit thread titled What do you miss about other languages when working in Rust?

10 Likes

on a more ironic note, there's also

& * 'a &'a Box || macro! mod crate extern crate #[...] String vs &str &self unwrap expect ? Rc Arc

by new community member @yjoking on this thread

src

5 Likes

"nau pli us : the first larval stage of many crustaceans, having an unsegmented body and a single eye."

At last, the proper term for a new Crustacean! (emphasis added)

25 Likes

I like "Nauplius"!
Obligatory Wikipedia link (after digging through a handful of redirects): https://en.m.wikipedia.org/wiki/Crustacean_larva#Nauplius
Several larval stages were apparently originally mistaken for separate species, and even today we don't know the match-up between all larvae and all adults. (Much like how Rust-the-language is still figuring things out!)

Plural is apparently Latin-style: "nauplii".

6 Likes

13 Likes

Summoning a Rust djinn, @alice:

3 Likes

I have no idea how to debug Rust, because in 2 years of Rust, I haven't had that type of low level bug.

19 Likes

Interesting question. One does not generally tell many anecdotal stories about bad things not happening

Yet they dislike Rust...

2 Likes

Hey, I can feel them! I love debugging! That feeling of leading an investigation, slowly uncovering the truth of what happened, why it happened, and how to make it right. And now, there's this new language that comes in and robs us of that pleasure?! I mean, I can see where they're coming from

9 Likes

Rust is simply a masterpiece. It is an amazing achievement of programming language design and implementation. There is nothing else like it.

5 Likes

While not Rust-related, I thought this quote had a balance of funny and insightful that may fit "quotes the community likes". Either way, it's worth more eyes.

It's a reply to ESR's 2008 retrospective on The Unix-Haters Handbook:

No, Python is not Scheme with funky syntax. Python is decrypted Perl.

That’s probably its biggest strength and a significant weakness as well.

6 Likes

One more from way down the cascade of comments of... variable quality:

I have concluded that the correct way, of thinking about OS’s is not as grand building designed and built for a purpose, with majestic skylines, but as city infrastructure, with streets and sewers, that should just work. However people will only notice your system when you overflow into the basement. A infrastructure that is not over taxed is in a city that is not growing, if your OS sucks because it is being taken places that won’t considered when it was first build, well there are worse fates.
-- Joe @ http://esr.ibiblio.org/?p=538#comment-228552

1 Like

Those quotes are hardly "of the week."

1 Like

Based on past submissions, I was under the impression that "of the week" could be relaxed into "that were discovered that week". (Though, admittedly, usually it was more "posted a week or two before the week of submission".)

1 Like

(Edit: a few days late, sorry; posted 9 days ago, bit didn't read it until just now)

CAD97 embraces the "confession" part of the Rust Confessional topic.

I like how it demonstrates the... perverse? effect of the Rust Community social standards: "came here for a quick joke, accidentally contributed meaningfully to the discussion.." is such a nice problem to have when interacting on the internet! @CAD97

18 Likes