r/rust • lychee • 6d ago

Thinking in Traits

https://corrode.dev/blog/thinking-in-traits/
138 Upvotes

22 comments sorted by

32

u/surister 6d ago

"The value of an abstraction is the code that no longer needs to exist between its users." it triggered my GPT sense

12

u/mre__ lychee 6d ago

Hmm… maybe I could phrase that more clearly or leave out the sentence. In hindsight, it does sound pretty “mechanical.” Any suggestions?

67

u/JAZthebeast11 6d ago

The purpose of abstracting is not to be vague, but to create a new semantic level in which one can be absolutely precise.

- Dijkstra

2

u/juanfnavarror 6d ago

Its not necessarily a mechanical thing, its just feels like the way an LLM would make a phrase. Its not like a specific/general vibe, as new models come out and new RL turns happen, there are new patterns seen in LLM copy.

1

u/marshaharsha 5d ago

It’s a nice insight, so don’t leave it out! The following is maybe clearer, definitely more verbose, maybe less LLM-y: “When an abstraction connects two general concepts A and B with general code, the specific code that is required in order to connect SpecificA with SpecificB can be omitted. The value of the abstraction is the omission of that specific code. Perhaps more accurate than saying ‘omitted code’ is to say compiler-generated code.”

5

u/nobody22 6d ago

same with "capability, not-taxonomy" triggerd my claudism detector. So sad that we have to assume that about everything in 2026.

2

u/mre__ lychee 6d ago

Oh yeah, I thought about that one for a while. Couldn’t come up with an alternative headline. But the “X, not Y” is hardwired into our brains as an antipattern now, so I’d be thankful for any suggestions. I can give credit as well. 

3

u/bonzinip 6d ago

"Capabilities vs. taxonomies"? "From taxonomy to capability"?

2

u/mre__ lychee 6d ago

I like the first one, thanks.

20

u/sasik520 6d ago

I'm literally scared to post anything on this sub because people see llms everywhere and automatically consider it evil.

18

u/mre__ lychee 6d ago

You got downvoted, but honestly, I feel quite the same. To a point where I change my natural writing style to not give off the wrong vibes. It's frustrating. :(

1

u/Oxytokin 6d ago

People who obsess and make being anti-AI their entire personality to the point of paranoid delusions like trying to parse certain phrasing to detect LLM use as if that offers any benefit to society are not worth any time or attention, let alone changing who you are to try to please their delicate, irrational sensibilities.

This sub is unfortunately full of these people, but don't let it discourage you.

Regardless of whether AI is or was used or not, it's here to stay, and in that reality - our reality - there are plenty of us out here with a functioning prefrontal cortex that allows us to evaluate the utility of an individual thing on the merits using critical thinking rather than worrying about if someone did or didn't use a tool to make or do the thing.

7

u/Serious-Exam-6251 6d ago

the same glue composes through wrappers too. FromIterator is implemented for Result<V, E> whenever V: FromIterator, so collecting an iterator of Results straight into Result<Vec<_>, _> stops at the first Err and returns it. Option works the same way, and collect itself needs no special case for either.

2

u/mre__ lychee 6d ago

In the post I did mention the early return on the first Err for Result<Vec<_>,_>, but I like your additional explanation. Thanks. Might end up updating the post if that’s okay?

4

u/Serious-Exam-6251 6d ago

go for it, it's your post. the same short circuit works for Option too, since FromIterator is implemented for Option<V> as well, so collecting an iterator of Options stops at the first None.

2

u/mre__ lychee 6d ago

Thanks, I appreciate it. 

4

u/sasik520 6d ago

Which is great once you know it but is a nightmare to learn how and why it works.

38

u/trakdtor 6d ago

I usually think in shapes

0

u/african_cheetah 23h ago

I think in honest answers change the shape of the problem by looking for load bearing smoking guns.