News for hackers. Stuff that matters.
Re:Safer Enums in Go by vlunkr on Saturday May 14, 2022 @11:29AM (#31378904)
Everyone check off "immediately making a Golang conversation about Rust"'on your HN bingo.
Re:Safer Enums in Go by gnulinux on Saturday May 14, 2022 @02:46PM (#31381036)
I'm absolutely baffled by this attitude in literally every single programming language thread in HN.

PLT and PL Design don't live in vacuum, it's a vast field that has been developing exponentially in the last years (just like any other CS discipline).

Any development in Haskell, Rust etc... Or other relatively mainstream frontier languages are fundamentally relevant to any other language's design. Period. All this bickering about "Rust in every thread" is excruciatingly misguided. Lessons we can learn from Rust will be highly influential on other languages and it's worth discussing these. Please keep this in mind before complaining for the 999th time.

Re:Safer Enums in Go by vlunkr on Saturday May 14, 2022 @04:04PM (#31381802)
It's fine to compare language design, and it can make for interesting discussion, but that's not what HN has been lately. It's just "Rust is better because it has x feature." If I wanted that level of discourse I'd go to /r/ProgrammerHumor and find the 10,000th "Python is better than Javascript" meme.

Is my comment any better? No probably not.

Re:Safer Enums in Go by gnulinux on Saturday May 14, 2022 @07:43PM (#31383813)
But this particular chain started as a discussion of how sum types are missed in every other language. Isn't that a very important observation?

Every programming language is an experiment: it tests whether an well-defined, particular model of computation ends up having advantages on human engineering results. Maybe it causes fewer bugs. Maybe it makes development faster. Maybe it makes certain features easier to implement.

So whether one language has a feature that's highly missed in other languages is the very basis of the debate.

I personally am not a Rust programmer, but not knowing Rust, but knowing another programing language that has sum types, it seems understable to me that it worths mentioning this for every language that doesn't have sum types. And when you do do that you might as well mention Rust as an example. (Maybe because it's more mainstream?)

Re:Safer Enums in Go by metadat on Saturday May 14, 2022 @03:17PM (#31381365)
It's a common phenomenon on HN, typically referred to as "a casual dismissal".
Re:Safer Enums in Go by stouset on Saturday May 14, 2022 @01:57PM (#31380557)
Are you really surprised or upset to see those types of comments when the article itself is fundamentally about trying to adapt Go to become more Rust-like?

Personally I think people can't help but notice the trend of Go users rediscovering bug-by-bug and frustration-by-frustration why Rust was designed the way it is.

Re:Safer Enums in Go by morelisp on Saturday May 14, 2022 @02:14PM (#31380718)
> the article itself is about trying to adapt Go to become fundamentally more Rust-like?

The article does not even mention Rust. Not every attempt to make something 'safer' is an attempt to make it 'fundamentally more Rust-like'. (And you're also misusing the word "fundamental" - even if we grant this is "Rust-like" this is adapting their code to make their Go programs practically more Rust-like.)

Re:Safer Enums in Go by stouset on Saturday May 14, 2022 @02:22PM (#31380783)
I should have said "the article itself is fundamentally about…", and not "Go to become fundamentally more…". Apologies. I've edited my comment.
Re:Safer Enums in Go by pjmlp on Monday May 16, 2022 @03:44AM (#31394478)
Not only Rust, there is plenty of programming language design experience between 1950 and 2009, but naturally that was PhD stuff not worth taking into consideration.
Re:Safer Enums in Go by vlunkr on Saturday May 14, 2022 @02:05PM (#31380629)
No, I'm not surprised, that's why it's on the bingo card. They are very different languages, so endlessly comparing them is tiresome.
Re:Safer Enums in Go by tempest_ on Saturday May 14, 2022 @12:18PM (#31379469)
Aw come on there was a whole two hours that this post was about Go before I showed up.

You gotta give the people what they want!

Re:Safer Enums in Go by politician on Saturday May 14, 2022 @12:16PM (#31379434)
The ‘safe’ keyword in the title is a Siren’s song to certain types of Rustaceans, so it’s not surprising.
Re:Safer Enums in Go by tialaramex on Saturday May 14, 2022 @05:39PM (#31382827)
I was reading this because hey, safer enums. But I agree, Sum types are a must have.

Particularly, decryption should be Authenticated, and so the correct return type of a decrypt function is a Sum type, and if you don't have Sum types you can't do that.