Do We Create Type Systems In Dynamic Languages?
codethinked.com
Do We Create Type Systems In Dynamic Languages?
1–10 of 27 posts
Re: Do We Create Type Systems In Dynamic Languages?
#2Re: Do We Create Type Systems In Dynamic Languages?
#3In fact, I'm sure my iteration time goes up in haXe because I see most errors at compile-time. The ones I don't see are logic and uninitialized values.
ed: I mean time goes down, not up. Progress goes up.
Re: Do We Create Type Systems In Dynamic Languages?
#4Not if you are doing it right. The article context is unit testing a dynamic languages vs a static language, saying that you have to do more testing with a static language. If you do thorough unit testing, the difference isn't all that great. The article implied that unit testing doesn't need to be as thorough with a staticly typed language, That is just plain wrong. You may need to do some additional testing with a…
A better comparison would probably be Python versus Scala, or Python versus OCaml.
Re: Do We Create Type Systems In Dynamic Languages?
#5That said, whereas many Rubyists can make more use of respond_to?(), I can make a few uses of is_a?() every now and then. They usually make use of more idiomatic Ruby that way than me.
On the Spec/Test side, I hope everyone is testing more functionality than types as I am sure the type checking is just redundant in Ruby. Speaking of redundancies, a famous motto is all you need to follow to keep it cool: "don't repeat yourself".
Re: Do We Create Type Systems In Dynamic Languages?
#6Not if you are doing it right. The article context is unit testing a dynamic languages vs a static language, saying that you have to do more testing with a static language. If you do thorough unit testing, the difference isn't all that great. The article implied that unit testing doesn't need to be as thorough with a staticly typed language, That is just plain wrong. You may need to do some additional testing with a…
The Python versus Java comparison is a red herring, I think. While Java is more verbose than Python, and some of that verbosity is from its type system, not all of it is. A better comparison would probably be Python versus Scala, or Python versus OCaml.
Re: Do We Create Type Systems In Dynamic Languages?
#7Not if you are doing it right. The article context is unit testing a dynamic languages vs a static language, saying that you have to do more testing with a static language. If you do thorough unit testing, the difference isn't all that great. The article implied that unit testing doesn't need to be as thorough with a staticly typed language, That is just plain wrong. You may need to do some additional testing with a…
The Python versus Java comparison is a red herring, I think. While Java is more verbose than Python, and some of that verbosity is from its type system, not all of it is. A better comparison would probably be Python versus Scala, or Python versus OCaml.
Type systems can be far more expressive than what is available in Java, and can and should be used to enforce program correctness, reducing the necessity for additional testing.
Type inference, polymorphic typing, structural types -- the available tools in a comprehensive type system are woefully under-explored by most practitioners who consider Java to epitomize type systems.
Re: Do We Create Type Systems In Dynamic Languages?
#8Earlier quoted context omitted.
The Python versus Java comparison is a red herring, I think. While Java is more verbose than Python, and some of that verbosity is from its type system, not all of it is. A better comparison would probably be Python versus Scala, or Python versus OCaml.
True, but I speak of which I know. If someone has such a comparison, I would love to see it. The real measure is tokens not LOC.
I can highly recommend:
http://www.xoltar.org/old_site/misc/static_typing_eckel.html...
The article (from 2003!) is an excellent treatise on the value of a proper type system as compared to Python, and moreover, how Java's type system (or C++, ...) should simply not be equated with "static typing".
Re: Do We Create Type Systems In Dynamic Languages?
#9EDIT: By "best of both worlds" I mean "concise code and the benefits of the program being well typed"
Re: Do We Create Type Systems In Dynamic Languages?
#10I think it's just wrong to test for the type of the variable, unless it's really needed. Such checking detracts from what you are trying to accomplish and from relying on the exception backtrace to give you a clue of what went wrong when an error occurred. Also relevant is that if you are trying to pass in a new object that should work despite not being a direct descendent of a certain object, by checking for a certa…