2 ms·
> and I would very much appreciate a stricter type system so it was apparent what arguments a function might accept, It is not completely impossible. For examp
by rdtsc 10y ago
> and I would very much appreciate a stricter type system so it was apparent what arguments a function might accept,
It is not completely impossible. For example, Erlang / Elixir, two other strict dynamically typed languages have had Dialyzer for years:
http://learnyousomeerlang.com/dialyzer http://learnyousomeerlang.com/dialyzer
You annotate your functions with types they accept and return. Run this tool and it shows inconsistencies. The more you annotate and the more precise the types, the more helpful it is. This is not Hindley–Milner types here (this is actually called Success Typing), but goes along way to do what you suggest i.e. you can have your cake and even eat some of it ;-)
Python now has mypy, that I understand is rather similar. Guido at least is rather fond of it. But it is still new and I haven't yet heard of it used in real world:
http://mypy-lang.org/ http://mypy-lang.org/