Re:Lies we tell ourselves to keep using Golang
by DanielHB on Tuesday November 26, 2024 @04:11AM
(#42243887)
You hit the main gripe I have with Go, its types system is so basic. I get people raving type-correctness of Go when they come from Python but the type Go system is simply pre-historic by modern day standards.
[ Parent
| on HN ]
Re:Lies we tell ourselves to keep using Golang
by masklinn on Tuesday November 26, 2024 @04:22AM
(#42243955)
Go’s type system is not even impressive compared to python’s.
Re:Lies we tell ourselves to keep using Golang
by orwin on Tuesday November 26, 2024 @04:40AM
(#42244068)
Do you have a pydantic equivalent in go? Also modern typing in python is starting to be OK to be honest (well, if you consider typescript typing OK), so it isn't really a knock on Go :)
Re:Lies we tell ourselves to keep using Golang
by Yoric on Tuesday November 26, 2024 @07:52AM
(#42245266)
> Do you have a pydantic equivalent in go?
I've been working on one [1].
But gosh, does go make it hard.
Re:Lies we tell ourselves to keep using Golang
by DanielHB on Tuesday November 26, 2024 @05:09AM
(#42244264)
Well I was comparing to python codebases before they added type annotations
Re:Lies we tell ourselves to keep using Golang
by Yoric on Tuesday November 26, 2024 @07:54AM
(#42245274)
Which, sadly, is still the case of too many dependencies.
While I much prefer Python as a language, Go wins against Python by having a fresher ecosystem, with a higher baseline for type safety. Still pretty low with respect to Rust or mypy/pyright with highest settings, but much better than any of the Python frameworks I've had to deal with.
Re:Lies we tell ourselves to keep using Golang
by yyyfb on Tuesday November 26, 2024 @05:14AM
(#42244317)
I feel that the future for Python people who want type safety will eventually be TypeScript on nodejs. Go was intended as an alternative to C++. It seems that in reaction to the ungodly complexity of C++, the creators wanted to avoid adding language features as hard as possible. If the user could work around it with a little extra verbosity, it'd be ok. I feel they removed too much and maybe not the right things.