3 ms·
Just took a quick look at paper #2, which is quite fascinating -- to try and isolate the effects of static / dynamic typing, they developed two slightly differe
by bkirwi 12y ago
Just took a quick look at paper #2, which is quite fascinating -- to try and isolate the effects of static / dynamic typing, they developed two slightly different programming languages which varied along only this axis.
I have some sympathy with this approach, but I'm not convinced you can actually separate things in this way. The type systems I actually find useful are not just a static analysis layer, but have significant impacts on the semantics of the language and the way libraries are designed. I'm not sure you could just 'turn off' the type system in Haskell and have anything even remotely sensible, for example.
I sometimes wonder if there's enough mature open-source projects in the wild now to be able to draw some statistical conclusions about the long-term effects of language choice, but that would be quite a project...
- StefanKarpinski 12y ago> I'm not sure you could just 'turn off' the type system in Haskell and have anything even remotely sensible, for example. You can actually do exactly this: https://ghc.haskell.org/trac/ghc/wiki/DeferErrorsToRuntime https://ghc.haskell.org/trac/ghc/wiki/DeferErrorsToRuntime Of course, the type system doesn't vanish but checking types is deferred until runtime, turing Haskell into a dynamic language with an unusually elaborate tag system.
- CHY872 12y agoIt does make Haskell a dynamic language, but also isn't really what's meant. Generally when people compare statically typed languages and dynamically typed languages, what they are doing is comparing the various ways in which the type system imposes restrictions. The way in which Haskell differs most strongly and obviously from Ruby is not that it catches the type errors at compile time - but that the type errors can be caught at compile time. This in general allows smarter tools - compare Eclipse for Java and the 'type hierarchy', 'find method calls', many refactoring calls and the far less rich tools available for Python.
- jules 12y agoIt's still not comparable to a dynamic language however. Simply constructing a list [1, "Hello"] will already produce an error. Dynamic languages usually allow this, and only signal errors when the values are used in an erroneous manner, like 1 + "Hello". It does exactly what it says on the tin: it displays type errors that were found at compile time with the same type system that regular Haskell uses, but the actual displaying is deferred until run time. There is no actual tag checking going on at run-time.
- deleted 12y ago[deleted]