by m0th87 · 15y ago · 0 comments
I don't get how the type inference remark is faulty logic either. Haskell is orthogonal because it is statically typed, but type inference when applied to dynamically typed languages certainly can provide a performance boost.
Which is funny because your first link states: "In C++, a weakly typed language, you can cast memory to any type freely as long as you do so explicitly."
I'm pretty sure the last time I read that article it said that there is no generally accepted definition of weak typing. This discussion seems to echo that.
Agreed. There ARE definitions but they aren't terribly specific, useful, or even very consistent. Funnily enough, the wikipedia article on strong typing includes C and C++ as an example of strong typing.
In this case anyway, I think it's clear that the author was really talking about the static vs dynamic distinction, and should have used those terms instead:
> Some languages are strongly typed, which means that the programmer must define the type of every class, function, and variable that he uses; tiresome, but it can have big pay-offs in terms of overall speed. Other languages, like JavaScript, are weakly typed, which means that the programmer doesn’t have to worry about such piffling minutiae; you can just write some code and let the compiler do the heavy lifting.
So to be more accurate, he was comparing explicit static typing with dynamic typing.
In fact if a language is strongly typed not defining anything will not necessarily have an impact on speed because it is possible to infer types statically at compile time like GHC does for Haskell.
In other words: I think we agree.