3 ms·
> #5 Fast compile time... which is an advantage over Python how exactly? Compiled code can have fewer runtime errors, that's a big win. I read this as golang i
by 8organicbits 4y ago
> #5 Fast compile time... which is an advantage over Python how exactly?
Compiled code can have fewer runtime errors, that's a big win. I read this as golang is better than python because it's compiled and golang is better than Java and C++ because the compiler is fast.
- mixedCase 4y agoThe advantage then is "the type system", not "fast compile time". And as far as type systems go, Go is one of the worst in mainstream usage.
- IshKebab 4y agoBut still better than Python's.
- kortex 4y agoDespite its warts, Python's type system is at least comparable to Go, and better in several areas. The type inference works really well much of the time without any assistance, you can use tools like pyre to generate types for untyped code, as well as tools for discerning types through running the application. Heck, you can even use HKTs in Python if you are willing to install a plugin/library. https://returns.readthedocs.io/en/latest/pages/hkt.html https://returns.readthedocs.io/en/latest/pages/hkt.html
- abyesilyurt 4y agoJust curious, which languages have better type systems?
- digisign 4y agoAll of them? Minus the dynamic/weaks, such as original javascript.
- pdimitar 4y agoRust, Haskell, OCaml, and many others. Golang's typing system is fairly half-done.
- mixedCase 4y agoTypeScript, Kotlin, Scala, Haskell, Rust, Swift, modern Java, C#, F#, OCaml, Reason, Elm, PureScript,... it's a long list. I'd also count Python with MyPy, but having a mostly untyped ecosystem means you can't take much advantage of it.
- brobinson 4y agoIt's easier to list which ones don't at this point. The Go team ignored the last 50 years of improvements in type systems.
- rbanffy 4y agoI can understand the point - compiling will do the same checks a type hint checker such as MyPy will do and it's a bit faster. I have that in my pre-push hooks, but a lot of people isn't used to the 90's when a compile could take minutes and demand a far less relaxed development pace.
- vips7L 4y agoJavac is extremely fast. It doesn’t have to do any optimizations.
- kaba0 4y agoI have a hard time believing Go compiler being faster than Java’s. Like, none of them do barely any optimizations, but Go still has to do a bit more.