3 ms·
I disagreed strongly with this post and was about to post a rebuttal, but then I realized there actually is a situation where untyped languages enjoy a concrete
by dkarl 15y ago
I disagreed strongly with this post and was about to post a rebuttal, but then I realized there actually is a situation where untyped languages enjoy a concrete, practical advantage because of the lack of compilation dependencies. That situation is when you are writing a module (something that would be a compilation unit in a typed language) that calls missing or nonexistent library interfaces, and you want to test parts of the module that do not depend on the missing APIs. In a typed language, you can't do it. You would have to satisfy the dependencies first so your code would compile, or you would have to copy snippets of your code out of the compilation unit into a REPL or another file so they could be compiled separately. In an untyped language, you can experiment with parts of the module and even start writing tests without having to make sure all of the module's dependencies are satisfied.
Aside from that one advantage, though, it's the same with types or without them. For a module as a whole, the compilation dependencies that exist in a typed language are the same as the runtime dependencies that exist in an untyped language. Whether you're using a typed or untyped language, you can write whatever code you want, but you can't do anything with it until you satisfy its dependencies. With that one exception, of course: in an untyped language, you can run code that doesn't depend on the missing APIs but happens to be in the same module as code that does depend on them.
Overall, I don't think that amounts to much, especially compared to a typed language like Scala where you can copy snippets into a REPL. Or even better, Ensime is an Emacs mode that is supposed to let you work with Scala the way Slime lets you work with Common Lisp. (I haven't tried it myself yet, but it exists, and people are using it for real work.)
- msie 15y agoYeah I really hated this post. Starts off with a flame-baiting title. Then resorts to very qualified statements to support it. After reading it I'm wondering if it matters at all and I'm feeling dumb all throughout the discussion. :-( Update: Aarghh, it's just aggravating to read an academic stirring up the pot over some point of theoretical purity. And I love theory too. ;-)
- stralep 15y agoI do not see a single reason why strongly typed language compiler couldn't have unsafe flag, to compile with undefined symbols, and to make your program fail/rise error/perform some other action when such symbols are evaluated or called. And I understand why this behavior would be unwanted in production systems.
- vog 15y agoNote that there is an interesting counter-argument in the following HN comment: http://news.ycombinator.com/item?id=2622491 http://news.ycombinator.com/item?id=2622491 This argument is also applicable to your concrete example, and explains how you can achieve modularity in a strongly typed language even in that case. The type system just has to be flexible enough to allow for module functors. In other words, the original article's argument holds only for strongly typed languages whose type system is too primitive.
- szany 15y agoFrom p. 3 of the paper "Why Dependent Types Matter": "We have given a complete program, but Epigram can also typecheck and evaluate incomplete programs with unfinished sections sitting in sheds, [···], where the typechecker is forbidden to tread. Programs can be developed interactively, with the machine showing the available context and the required type, wherever the cursor may be. Moreover, it is Epigram which generates the left-hand sides of programs from type information, each time a problem is simplified with ⇐ on the right."
- Martijn 15y ago> (...) in an untyped language, you can run code that doesn't depend on the missing APIs but happens to be in the same module as code that does depend on them. So this advantage is about writing code that isn't intended to be compiled or run yet. I can do that in a statically typed language too: I just put the code in a comment block. Or am I missing something here?
- dkarl 15y agoNope, you're not missing anything. That's another valid workaround, which undermines the practical advantage of untyped languages yet a little bit more.