tag:blogger.com,1999:blog-65083961482497982.post7345543669872164863..comments2008-11-10T23:43:03.019-05:00Comments on pl patterns: Static Vs. Dynamic TypingUnknownnoreply@blogger.comBlogger10125tag:blogger.com,1999:blog-65083961482497982.post-71987737439138468662007-10-11T12:01:00.000-04:002007-10-11T12:01:00.000-04:00I agree mostly with you. I just want to note that ...I agree mostly with you. I just want to note that the fifth benefit of dynamic typing is a myth only to a certain degree. Most discussions are between advocates of C++ and Java versus Javascript, PHP and Ruby. In that context hardcoding functions to use short and int, or having to refactor class hierarchies or create additional interfaces when only a subset of methods from a class is needed in a new situation slows down prototyping. Some of that can be mitigated by the judicious use of templates and generics at the cost of additional boilerplate code. But it does not help me any when people on the web invoke a good type system for their arguments while in the real world coworkers later reuse those same arguments to force everyone to use C++, C# and Java over any dynamic language because "a language with static typing is better". That said, I really wish ML was more widespread in the industry; I would love to use it instead of C++ or Java.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-65083961482497982.post-91570760870196512852007-10-05T09:50:00.000-04:002007-10-05T09:50:00.000-04:00I don't fully agree when you say dynamic typing is...I don't fully agree when you say dynamic typing is a special case of static typing. That may be true if you take the computer perspective, but if you take the expression perspective (which I consider much more useful and important) it's the other way round, static typing actually is a special case of dynamic typing.<BR/>When you go static you take expression power away from the programmer.<BR/><BR/>cheers.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-65083961482497982.post-84942335269632907782007-09-25T17:17:00.000-04:002007-09-25T17:17:00.000-04:00Your statements apply to Standard ML and not to OC...Your statements apply to Standard ML and not to OCaml or Haskell, of course.Jon Harrophttps://www.blogger.com/profile/11059316496121100950noreply@blogger.comtag:blogger.com,1999:blog-65083961482497982.post-19788620578952450392007-09-13T16:40:00.000-04:002007-09-13T16:40:00.000-04:00There are also more comments on reddit: http://pro...There are also more comments on reddit: <A HREF="http://programming.reddit.com/info/2nyne/comments" REL="nofollow">http://programming.reddit.com/info/2nyne/comments</A>Jon Thttps://www.blogger.com/profile/06761280566170515580noreply@blogger.comtag:blogger.com,1999:blog-65083961482497982.post-78870176008110466022007-09-11T12:34:00.000-04:002007-09-11T12:34:00.000-04:00Myth: Dynamic typing allows for faster prototyping...<I>Myth: Dynamic typing allows for faster prototyping due to not having to write down types which change often during prototyping</I><BR/><BR/>I am not sure that is a myth in fact. That's often said of dynamic languages meaning general purpose scripting languages like Python, Perl, Ruby, etc. In those languages I think it is a practical fact that you can prototype faster than in system languages in general.<BR/><BR/>But you could have a dynamic C, so to speak, a dynamically typed language, small and with very limited expressiveness. I think you wouldn't prototype faster there than in a richer systems language.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-65083961482497982.post-13501475527764124612007-09-11T12:07:00.000-04:002007-09-11T12:07:00.000-04:00Actually, the value restriction is there for sound...Actually, the value restriction is there for soundness, not optimization (http://www.smlnj.org//doc/Conversion/types.html).Unknownhttps://www.blogger.com/profile/07026914613096114812noreply@blogger.comtag:blogger.com,1999:blog-65083961482497982.post-77552830780195627022007-09-11T08:27:00.000-04:002007-09-11T08:27:00.000-04:00You left out one interesting piece of the strong-t...You left out one interesting piece of the strong-typing and testing discussion. While strong-typing is certainly not a substitute for testing, it does make more comprehensive unit testing easier. QuickCheck for Haskell is an example of this.<BR/><BR/>-R HayesAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-65083961482497982.post-60121405373009807042007-09-11T07:32:00.000-04:002007-09-11T07:32:00.000-04:00And as usual, when "Future of <something>" a...And as usual, when "Future of <something>" appears when talking about programming language design, LISP had all those for years... oh well.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-65083961482497982.post-62023159240736758072007-09-11T06:13:00.000-04:002007-09-11T06:13:00.000-04:00As for the third claimed benefit of dynamic typing...As for the third claimed benefit of dynamic typing, don't you think that structural subtyping allows for late binding and something you could equate to duck typing?<BR/><BR/>In particular, it seems to me that things like OCaml's row variables, which extend the ordinary parametric polymorphism, allow you to code the same way you'd do in a dynamically typed language if you choose to, without relinquishing the other benefits of static typing (going back to OCaml, you can use one of the available OO wrappers of the structures in the stdlib). <BR/><BR/>It is true that the choice is to some extent determined by the style of the code you have to interact with, so in OCaml's case you'll normally use good old algebraic types without subtyping because the standard library is not object-oriented (and also in order to avoid slow method dispatching). However, this is a choice motivated by practical concerns, not an imposition of the type system.<BR/><BR/>Also, regarding your rebuttal of the fifth claimed benefit of static typing, it is manifest that static typing disallows many programs a dynamic typing discipline wouldn't, namely all those that would result in a run-time type error, and then some (those programs that don't type but would actually work). However, couldn't it be argued that in the presence of type inference there's some gain in conciseness since many invariants are documented by the type signatures? (This has got nothing to do with dynamic typing being "less powerful" because it's a special case of static typing. I agree that this argument is flawed, for the above stated reason.)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-65083961482497982.post-44631557217948104022007-09-10T23:17:00.000-04:002007-09-10T23:17:00.000-04:00If you havn't already heard of it, you may want to...If you havn't already heard of it, you may want to look at QI.<BR/><BR/>http://www.lambdassociates.org/aboutqi.htm<BR/><BR/>I think it's pretty close to your future language.. it's got the dynamic/static blur, strong inference, and the turing complete type system anyway.Anonymousnoreply@blogger.com