3 ms·
5x(probably more) reduction on server costs because of less memory/cpu requirements, if you choose Go for example.
by rantanplan 8y ago
5x(probably more) reduction on server costs because of less memory/cpu requirements, if you choose Go for example.
- joshuamorton 8y agoAh, so your reasons to pick a different language are based not on type safety, but on performance. Indeed there may be a plethora of valid reasons to pick another language over python for some project. But that wasn't the question.
- rantanplan 8y agoType safety of Go is leaps and bounds better than python's will ever be, with mypy or not.
- joshuamorton 8y agoThat's just factually untrue. Mypy supports generics, protocols, (via extensions) dependent types, and user-defined covariance rules. Its leaps and bounds more powerful than go's type system. Pytype adds type inference to that list. You end up with a type system that's closer in power to Scala's or Haskell's than Java or Go's.
- rantanplan 8y agoMypy's various bugs are just indicative of how much of a band-aid it is. If you truly believe that a dynamic language like python can have type safety, then imagine what a language like Go can achieve. Python already has deviated too much from where it started and mypy offers too little to justify the verbosity. So I guess we'll see what the future holds for them.
- viraptor 8y ago> Mypy's various bugs are just indicative of how much of a band-aid it is. I think you're confusing an idea with an implementation. Bugs can be fixed. If mypy is useful, it will remain useful and slightly more stable.
- joshuamorton 8y ago>If you truly believe that a dynamic language like python can have type safety, then imagine what a language like Go can achieve. Literally exactly the same thing, but no more. Mypy and Go's compiler have the exact same information available at compile time. Python stops being a dynamically typed language when you add Mypy. It becomes statically typed. Calling it "dynamic" is like calling C++ "dynamic" because C++ doesn't have access to run-time type information (usually). Actually that's not true, due to the increased expressiveness of Mypy's type system, it has more information available. Mypy has more information. It can do stronger analysis. Go has less information, it can't do as much. Go can make language (syntax) changes to improve this. Python has been very smart, and the type system is implemented as normal objects using the normal syntax. Adding new types, even "special" ones (like Union or Interface) doesn't require modifying the language itself, but can be done only with modifications to a fairly nimble standard library module. This allows python's type system to evolve much more quickly than Go's has shown itself capable of. >Python already has deviated too much from where it started and mypy offers too little to justify the verbosity. But python's type system offers more than Go's, and isn't particularly more verbose, so what are you saying here about Go's type system?
- rantanplan 8y ago> Go can make language (syntax) changes to improve this. Python has been very smart, and the type system is implemented as normal objects using the normal syntax I will leave this tidbit here: i, found = 0, False # type: int, bool In any case, I find these new "typing" features very awkward, overly verbose and not the reason that I chose python in the first place. If I am to write all this non-pythonic stuff to be 10x+ slower, less memory efficient, awful at concurrency and still not having solved the packaging/deployment situation... I will just use Go. Or any other language in that league, that offers so many more nowadays.
- joshuamorton 8y ago> i, found = 0, False # type: int, bool That's actually i, found: Tuple[int, bool] = 0, False in python3. Which as I said, uses normal objects and normal syntax. As for the rest of your comment, I think that's been well discussed. There are a variety of non-typing reasons to use go over python. But if you are about type safety you're probably better off with modern python than modern go.
- tropo 8y agoGo has to be better than that. Java beats Python by a factor of 10, and C beats Java by a factor of 10. C is beating Python by a factor of 100. I would expect Go to be a bit faster than Java.