Loren Segal: Too Lazy to "Type"
gnuu.org
Loren Segal: Too Lazy to "Type"
1–10 of 36 posts
Re: Loren Segal: Too Lazy to "Type"
#2The significant point missed is that I can start typing the program without having figured out what the types will be. After the fact you can do the translation, but postponing having to work out not immediately relevant details is huge for developers.
Re: Loren Segal: Too Lazy to "Type"
#3Re: Loren Segal: Too Lazy to "Type"
#4Re: Loren Segal: Too Lazy to "Type"
#5I find that deeply reassuring, since that's the core idea behind Magpie, the language I'm working on. It's a dynamic language with a static type-checker. The idea is that it runs dynamically at load time so you can imperatively and dynamically build your types and then after that, it statically checks the results, then invokes main() and (presumably) runs in a more or less static fashion after that.
Re: Loren Segal: Too Lazy to "Type"
#6As a heavy user of statically typed languages who is learning JS and Scala currently, can anyone with more experience with dynamically typed languages confirm or deny the point of the article. Scala, with it's type inferencing seems like it might be a happy medium between. Thoughts anyone?
Re: Loren Segal: Too Lazy to "Type"
#7The point of the article is that virtually all real Ruby programs could be transformed, after the fact, into statically typed programs. The significant point missed is that I can start typing the program without having figured out what the types will be. After the fact you can do the translation, but postponing having to work out not immediately relevant details is huge for developers.
Re: Loren Segal: Too Lazy to "Type"
#8As a heavy user of statically typed languages who is learning JS and Scala currently, can anyone with more experience with dynamically typed languages confirm or deny the point of the article. Scala, with it's type inferencing seems like it might be a happy medium between. Thoughts anyone?
Type inference is nice and goes a long way, but it's still fundamentally different from being able to modify types imperatively at load time. For example, in Ruby, it's trivial to swap out a method with a version that does some logging, but only on Tuesdays. Scala can't really do that because it presumes all types are locked down before any code (such as code to tell if today is Tuesday) has executed.
Re: Loren Segal: Too Lazy to "Type"
#9I wonder what the performance benefit of adding optional type hints to ruby or python would be.
The compiler gives enormous optimizations for certain (admittedly extremely specialized) numerically intensive programs / calculations. Of course, if the compiler was developed further (it might be, actually), you'd probably see optimizations for larger sets of programs.
Re: Loren Segal: Too Lazy to "Type"
#10Earlier quoted context omitted.
Type inference is nice and goes a long way, but it's still fundamentally different from being able to modify types imperatively at load time. For example, in Ruby, it's trivial to swap out a method with a version that does some logging, but only on Tuesdays. Scala can't really do that because it presumes all types are locked down before any code (such as code to tell if today is Tuesday) has executed.
One of the points in the article is that this kind of behaviour modification is not done that often. Yea, it happens... but not as much as you'd think.