HN2new | past | comments | ask | show | jobs | submitlogin

> Python is in fact a type safe language for a while now

Well it has a typing mechanism, which is better than nothing, but has the mechanism been shown to be safe? C has types too, but I'm not sure that it would be described as type safe.



C is weakly typed. Python is strongly typed. That's orthogonal to 'having types'.


There is no agreed-upon definition of weakly and strongly typed; It is a nonsense word. Any Haskell programmer would laugh at someone who calls Python strongly typed.


> There is no agreed-upon definition of weakly and strongly typed; It is a nonsense word.

Sure there is. Strong typing means a language doesn't permit implicit type coercions.

> Any Haskell programmer would laugh at someone who calls Python strongly typed.

I'm sure lots of programmers are not particularly educated on the topic; it doesn't mean the word is 'nonsense'.


Showing a typing mechanism to be safe is a very hard thing to do. There are a few methodologies I'm familiar with. What most people think about - formal proof - doesn't work for semi-obvious reasons (as you can easily reduce "is this program safe" to the halting problem).

The research I've seen is basically:

- Take a class room of independently selected subjects (read: CS undergrad students).

- Give them the same coding problem in multiple languages or in the same language with or without compile time type checking.

- Measure the number of defects said programs have and hopefully draw a conclusion about the safety of the language.

All the research I've read on the topic has been pretty poor (though maybe I'm just bad at finding it).

Indeed there is no such research for typed Python (although the pluggalbe types research in general is great) but there is also no such research (that I've found) for Idris, ReasonML, Swift, Haskell, Rust or any of the usual "suspects" for "good types".

Please enlighten me :]




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

Search: