Comment by Myrmornis

Comment by Myrmornis 2 days ago

6 replies

I think your comment needs to mention that Python has syntax for type annotations and two mature type checkers (mypy and pyright) with more under development. Python is thus very much part of the modern statically typed languages scene (moreso than Go) whereas Ruby isn't at all. Many people wouldn't touch Python today if it weren't for this.

pansa2 2 days ago

> Python is thus very much part of the modern statically typed languages scene (moreso than Go)

Python’s type system is substantially more complex than Go’s - it’s probably more complete, but given it’s optional nature, less sound.

In “modern” type systems, is completeness considered more important than soundness? The success of TypeScript suggests it is.

  • kaba0 2 days ago

    Since basically every single type system has escape hatches (casts), yes, I would say completeness is more important than soundness.

pansa2 2 days ago

> two mature type checkers

I’ve never quite understood how this works. Surely a type system is absolutely fundamental to a language - how can you have multiple incompatible ones?

Do you need to choose a particular type checker for each project? Are you limited to only using third-party libraries that use the same type checker?

  • t43562 2 days ago

    I think Python was successful because it started off without a type system and you can still choose not to use it. Duck typing is the big feature really.

    It might float your boat to think about types but why would everyone have to want the same thing?

  • baq 2 days ago

    Look at JavaScript and typescript - Python’s typing is maybe halfway to that gold standard but there were other typed languages based on js. Python is special in that it provides type hinting syntax which is not used by the interpreter, so writing types doesn’t require the Byzantine build systems of js.

RMPR 2 days ago

> syntax for type annotations and two mature type checkers (mypy and pyright)

I would throw Pyre in there too