Hacker News new | ask | show | jobs
by saagarjha 52 days ago
I would not say that Go and Rust have similar paradigms
1 comments

You’re conflating paradigms with idioms.

Go and Rust have different idioms and syntax. But they occupy broadly similar paradigms.

For example, you don’t need to relearn how to do iteration like you would with a logic or pure functional language. You wouldn’t need to concepts like methods, like you would if you were coming from a stack based language. Etc

I think this comment weasels around the intent of the poster without acknowledging their meaning.

Go and rust have very little in common. If you consider them to be the same paradigm that's fine. But I don't think most people would as rust leans more functional.

“Leaning into functional” isn’t a hard thing to learn. However pure functional is when coming from an imperative language.

And that’s the point I was always making. Rust takes inspiration from different languages than Go. But there is a huge amount of borrowed experience you can lean on when switching between Go and Rust. You’re not starting from scratch.

Perhaps the real problem here is that developers stick to a subset of similar imperative languages and then moan that minor differences are hard to reason about?

I don't think the differences between go and rust are minor.

You aren't starting from scratch in the same way that if you have written javascript you aren't starting from scratch writing c++.

They might share some paradigms (focus on low level optimization) but they aren't the same.

Go focuses on heavy runtime, looser type systems, and all the benefits and drawback that brings.

That’s not what people mean when they talk about paradigms in programming languages.
Ok, but still they share some programming language paradigm, but not all. They both are imperative, concurrent and functional, but Rust is generic, Go is not. Rust is structured, Go is OO.
...which is basically a convoluted way of agreeing with me that there is shared knowledge one can call upon when moving between those two languages.