4 ms·
Why not move on to using ocaml (or shudder haskell) if you need types, adding types python seems like a pretty big undertaking
by marshallp 15y ago
Why not move on to using ocaml (or shudder haskell) if you need types, adding types python seems like a pretty big undertaking
- dorkitude 15y agoExplicit types are neither pythonic nor unpythonic: always using explicit types is unpythonic, but explicit is better than implicit is an important piece of 'import this'. I released DStruct because it has been insanely useful in my work. Take it or leave it, but do so pragmatically: dogma is a terrible way to make decisions.
- marshallp 15y agoI'm not being dogmatic. I'm a proponent of dynamic/typing and oo, they all fit perfectly in their use cases. I'm just not fan of mixing things up, the right tool for the right job. If you need types in python, you're writing a significant program in which case it's better to switch to java or better yet ocaml/haskell.
- dorkitude 15y agoSo you're saying one shouldn't write significant programs in Python? With that I must disagree :)
- marshallp 15y agoWell, either programming language researchers such as simon peyton jones are wrong, or developers such as google employee working on appengine, guido van rossum is wrong.
- dorkitude 15y agoThis is a subject near and dear to my heart, and I'm sure we could have a lovely chat about this -- got Skype?
- marshallp 15y agoi've added my email to my profile. however, i'm an antisocial recluse and never skype/im. there's lambda-the-ultimate if you're into programming languages, far more knowledgeable people than me hang out there.
- andrewcooke 15y agoit's difficult to explain everything in a short post, but the type checking part is really a "free extra" that comes from adding type-related metadata that can be used for many other purposes. for example, pytyp can convert between nested json dictionaries and python objects simply by introspecting type annotations. so the motivation was not so much to change the language, but more to explore how type-related annotations could be used in a language like python, in a useful way, without making it something other than python. in other words, the library is the end result of a process of exploration of some ideas that interested me related to metadata and types in a dynamic language. it's not an attempt to make python like another language, although (of course) it borrows ideas from those languages (because people have already spent a lot of time thinking about how to make a type system orthogonal and elegant). and because it's dynamic, metadata-based, uses reflection, and works with duck typing, pytyp's type checking is inefficient for global use. it makes more sense as a check when debugging than a global language feature.