Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Go is hardly a replacement with its weaker type system.


A weaker type system than Python?


Yes, as you can see for what is possible to express with Pyright.

Just because Python is dynamic, doesn't mean it lacks the notion of a type system, or the whole set of concepts that Go has no way to express, like meta-classes, multiple inheritance, comprehensions (eager or lazy),....

Many folks going from Python to Go, would never done it if Python had a modern JIT on CPython, or the package management wasn't the way it is, hardly anything to do with the language itself.


I don't quite understand what's the point of a type system when it's going to be defenestrated by dynamic typing. In javascript the typeof operator can be used to check the type.


Because the runtime still takes advantage of those concepts, an array doesn't stop being an array, and magically turns into a list, with different hardware requirements only because a language is dynamic.

Same applies to all other remaining types.

That is how even though people see Lisp as a dynamic language using only lists, in reality most Lisps (and Schemes) since the 1980's have all necessary types to write machine friendly code (aka mechanical sympathy), including having existed graphical workstations that only failed the market because UNIX and C were as cheap as free beer for all pratical purposes.


The type system still allows organizing and abstracting code in standardized ways.

Static type checking is nice and is certainly my preference, but dynamic type checking doesn’t mean no types. It means the types are checked at runtime.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: