Live data from Hacker News

My least favorite Rust type

ridiculousfish.com

21–30 of 298 posts

Re: My least favorite Rust type

#22
post #6

I feel like this is an example of what Jonathan Blow calls a "Big Idea" or a "100% solution". His thesis is that when you make a feature of a language too abstract and usable in many different contexts, eventually there will be so many corner cases that the result will almost certainly be clunky and full of footguns. He claims that language designers should aim for "80% solutions" instead, which cover most common usa…

Reminds me of D at times. It has many fancy features and powerful metaprogramming. But it also comes with drawbacks, many simple language improvement proposals are being shot down because they break in presence of some advanced usage of those features.

Re: My least favorite Rust type

#23

Quoted post unavailable.

I don't think it's reasonable to make a comment like this without explaining why. He has designed a programming language, so it seems fair to assume he'd have an understanding of programming language design.

You got a link for the compiler for said programming language?

Re: My least favorite Rust type

#25
I actually love this type. Specifically because you can build ranges over complex key types. For example, two keys in a BTreeMap can be used to define a range selector to collect items out of the map, it made me very happy to be able to do this:

https://github.com/bluejekyll/trust-dns/blob/main/crates/ser...

Re: My least favorite Rust type

#26
post #6

I feel like this is an example of what Jonathan Blow calls a "Big Idea" or a "100% solution". His thesis is that when you make a feature of a language too abstract and usable in many different contexts, eventually there will be so many corner cases that the result will almost certainly be clunky and full of footguns. He claims that language designers should aim for "80% solutions" instead, which cover most common usa…

This statement seems very true, even to the point of “duh” for people who have designed and maintained semi-widely used API or applications. I wonder where the language design wisdom to the contray come from.

Re: My least favorite Rust type

#27

Earlier quoted context omitted.

Because I can't download a compiler for his language and try out his ideas. I've designed fantasy programming languages, too, but you don't see me telling everyone on the internet that will listen to me about them, dragging other PL designers that have actually released working code through the mud as I do. It's a simple matter of put up or shut up.

I neither know Jonathan Blow, nor understand why he must create a programming language to critique them - is he someone who works on programming languages as his day job, for some time, yet somehow has avoided enforcing his opinions on himself?

He's a video game designer.

Re: My least favorite Rust type

#28
post #7

Earlier quoted context omitted.

Just because it has been debated extensively doesn't mean it's not a wart. Having run into the "reverse range does not contain what you obviously expect it to contain" before and wasting a few hours on it, like many other people have and will continue to do in the future, definitely makes me want to call it a wart.

Rust tries to be conservative with its semantics. You can always create your own range type and implement a deref/from for it to convert it to Rust range.

A well known wart that can be worked around is still a wart.

Re: My least favorite Rust type

#29
post #6

I feel like this is an example of what Jonathan Blow calls a "Big Idea" or a "100% solution". His thesis is that when you make a feature of a language too abstract and usable in many different contexts, eventually there will be so many corner cases that the result will almost certainly be clunky and full of footguns. He claims that language designers should aim for "80% solutions" instead, which cover most common usa…

Then again, TFA analyzes Range in a vacuum, as if some Range must make sense in arbitrary context A but also arbitrary context Z.

In reality, Range of some T generally makes sense in a local API or program. Even if that same Range doesn't necessarily make sense in every other place T might be used.

Re: My least favorite Rust type

#30
post #6

I feel like this is an example of what Jonathan Blow calls a "Big Idea" or a "100% solution". His thesis is that when you make a feature of a language too abstract and usable in many different contexts, eventually there will be so many corner cases that the result will almost certainly be clunky and full of footguns. He claims that language designers should aim for "80% solutions" instead, which cover most common usa…

Now that I know the details of Rust's range type it is extremely weird. The constraints need to be separate types. Why should range be so general as to support things that are obviously not ranges, only to return values indicating the range is malformed?
Post reply on HN