Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Untapped potential in Rust's type system (jakobmeier.ch)
22 points by valand on June 15, 2021 | hide | past | favorite | 7 comments



Whoops. We invited a repost of the OP but either didn't realize that it was a dupe, or we sent it before that one got traction. Sorry valand!


No worries! I appreciate the invitation! Thanks

Second-chance pool is a good moderation process


To me, this quite clearly illustrates the problem with languages like rust.

They're not simple.

Clever programmers flock to them because they have some neat features that seem as if they 'cleverly' simplify the code. The problem is, using these constructs on top of each-other creates code that's increasingly hard to parse as things get deeper.

I'd put rust in the lineage of scala, and even perl. They attract programmers that love the beauty of the code - good programmers - but they don't actually help accomplish making maintainable code that solves problems.

This is, ultimately, why these languages always occupy a niche but never graduate from it.

I'm glad these exist to explore the possibility space. More boring languages will adopt, conservatively, the wins found in the experiment.

But if I want to get something done, it's boring languages with boring constructs.


This may be true as some kind of rule of thumb, but it's not an axiom. In spite of its complexity, the most appealing thing about rust to me is that it very specifically allows me to write very very maintainable, very re-factorable code in ways very few other practical languages have.

To me it is the language that learned from the experiments, and brings most of the safety promises of, for eg., haskell down to earth.

It is also complex, and certainly does create a lot of opportunities to get lost in the weeds, but I have literally never trusted a compiler to help me write correct, safe, and reasonable code more than I do with rust.


> They attract programmers that love the beauty of the code - good programmers.

I see Rust as the inverse of this. The resulting code itself is not as concise and not as beautiful as other language can be. This problem is inherent to the problem Rust is trying to solve. But it communicates clearly what the developer intends to do.

> - but they don't actually help accomplish making maintainable code that solves problems

It may not solves your immediate problem, but Rust have solved a lot e.g. figma, discord, aws firecracker. It is just relatively a young language, because it grows slow, or supposed to be slow because of its wide range of capability, for that matter.

> But if I want to get something done, it's boring languages with boring constructs.

"Boring" is vague to describe a language. Choosing a language is always about matching the PL user's requirement and the PL APIs itself.

Tbh, TypeId and generics is the only Rusty thing in this article. Most of the other stuff is the author's invention to demo them. Usually for polymorphism. And it's pretty simple actually, you can just write it in TypeScript in the same way.


> I'd put rust in the lineage of scala, and even perl. They attract programmers that love the beauty of the code - good programmers - but they don't actually help accomplish making maintainable code that solves problems.

I suspect you _vastly_ underestimate how many problems perl has solved in the last 30+ years...

(But I'm an old-school Perl guy who's really really interested in Rust, so maybe this is my perception that's skewed?)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: