Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm not much a fan of adding all these custom keywords to function signatures. I hate to use use the m-word, but it really seems we are dancing around how to express monadic concepts in the language.

I should note that I don't really want monads in Rust, I like them in Haskell but I've never felt Rust really needed full HKT & monads. It just feels wrong to me that we might add more syntax to the language & fn signature for each of these discrete concepts. So we have async, now we add the 'default' fn "color" and the "try" fn color, more colors feels like the wrong way to solve this problem to me. I don't know the answer here it's just a sense I get... anyone else?

I was really taken by carl's post on async and how they discussed how .await could be removed https://carllerche.com/2021/06/17/six-ways-to-make-async-rus.... If we're concerned about having "colored" functions, maybe this is the avenue we should be exploring rather than lifting all the different colors out of the type signature and into special keywords?



The reason you get that sense is that we as programmers are drawn to the idea that generic solutions are the correct ones, and that special cases are bad. A HUGE part of our disciple is about creating and then welding abstractions.

However, as Alan Perlis famously said, “a programming language is low level when its programs require attention to the irrelevant.“ In general, Rust’s default stance is that these details shouldn’t be abstracted away, because they actually matter.

This is the fundamental tension that exists here.




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

Search: