4 ms·
So you're ok with Python, which doesn't have sum types or null safety, 2 out of 3 things you say are missing in Go. In fact, Python didn't have any compile-typ
by kjksf 2y ago
So you're ok with Python, which doesn't have sum types or null safety, 2 out of 3 things you say are missing in Go.
In fact, Python didn't have any compile-type type until recently and compared to Go is slow and bloated.
So maybe the issue is not Go's lacking some features but something entirely different.
- lairv 2y agoclass A: def __init__(): pass def f(self): pass def g(a: A | None): a.f() (edit: I don't know how to format code on HN) If I activate type-checking in VS Code this will highlight an error, although the python interpreter will indeed try to run it without compile time error As I said, for my side projects this is enough for me to model my problems properly without having to resort to multiple hacks And I took Python as an example, I also enjoy using Ocaml and Rust
- steveklabnik 2y ago> I don't know how to format code on HN two spaces: https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc
- mapcars 2y agoMypy supports those for like 3-4 years already
- xigoi 2y agoPython is dynamically typed, so everything is a sum type.