Revenge of the Types
lucumr.pocoo.org
Revenge of the Types
1–10 of 137 posts
Re: Revenge of the Types
#2Re: Revenge of the Types
#3 So not long ago someone apparently convinced
someone else at a conference that static typing
is awesome and should be a language feature. I'm
not exactly sure how that discussion went but the
end result was that mypy's type module in combination
with Python 3's annotation syntax were declared to be
the gold standard of typing in Python.
Ronacher is referring to the fact that Guido van Rossum, the Python language creator and BDFL, recently said he wanted to make mypy's type annotation standard into a standard by making use of Python 3 function annotations.The original function annotations standard is PEP-3107[1], GvR's proposal is on the python-ideas list[2], and information on mypy can be found at the project's site[3].
I agree with Ronacher's conclusion; I don't think static types -- even if only used at runtime -- are a good fit for the language. As for function annotation syntax, I think we just need to admit that isn't really good for anything.
Great article!
[1]: http://legacy.python.org/dev/peps/pep-3107/
[2]: https://mail.python.org/pipermail/python-ideas/2014-August/0...
Re: Revenge of the Types
#4[deleted]
Re: Revenge of the Types
#5Is this kind of flawed type system worth it? Hell yes. I've maintained large programs in both Python and (closure-compiled) Javascript, and with the former I've wished I had the help of the limited type checking available in the latter.
Re: Revenge of the Types
#6Re: Revenge of the Types
#7 float drop(float x0, float duration) {
float x = x0;
float t = 0;
float v = 0;
float g = -10;
float dt = 0.01;
while (t /1000); // abbrev for a cast: (float).001
}
Then I want the compiler to check that I'm not mixing up my units. It seems like this would be really useful, but I've never seen it before.Re: Revenge of the Types
#8Random question for the type experts out there: is there any language that lets me track the units of my numeric variables? For instance, something like this: float drop(float x0, float duration) { float x = x0; float t = 0; float v = 0; float g = -10; float dt = 0.01; while (t /1000 ); // abbrev for a cast: (float ).001 } Then I want the compiler to check that I'm not mixing up my units. It seems like this would be…
Re: Revenge of the Types
#9Random question for the type experts out there: is there any language that lets me track the units of my numeric variables? For instance, something like this: float drop(float x0, float duration) { float x = x0; float t = 0; float v = 0; float g = -10; float dt = 0.01; while (t /1000 ); // abbrev for a cast: (float ).001 } Then I want the compiler to check that I'm not mixing up my units. It seems like this would be…
Re: Revenge of the Types
#10Random question for the type experts out there: is there any language that lets me track the units of my numeric variables? For instance, something like this: float drop(float x0, float duration) { float x = x0; float t = 0; float v = 0; float g = -10; float dt = 0.01; while (t /1000 ); // abbrev for a cast: (float ).001 } Then I want the compiler to check that I'm not mixing up my units. It seems like this would be…