|
|
|
|
|
by WalkerCodeRangr
4457 days ago
|
|
Actually, I don't start with the premise that static typing is bad. I actually prefer static typing and if I was designing a language from the ground up it would probably be statically typed. In my day job I work largely in C# and JavaScript and much prefer C# (though it could be better). Unfortunately, we have an dynamically typed foundation (in JavaScript) to work from which makes it very difficult. None the less, dynamically typed prototype based languages can be powerful and have their advantages. I actually really like Haskell though I have never had the chance to do a project in it. I appreciate the strong type inference and its flexibility in static typing. I occasionally find myself frustrated my C#'s limitations around complex typing. Like that there is nothing close to existential types and you can't create more complex generic type constraints. Scala seems cool in what little I have read about it. I really respect Martin Odersky who designed it. I'd like to learn more about it, until I do I can't speak much to it. |
|
> The problem with JavaScript is not that it is a dynamically typed prototype based object-oriented language without classes. That is actually JavaScript’s strength.
the above suggests disliking static typing as a premise.
At dox (http://www.usedox.com) our stack is basically haskell/yesod in back typescript/angular up front. sure there are annoying limitations of typescript relative to haskell but compared to any of the AltJSs that we've looked at or used (coffee script, elm, fay, roy, purescript, dart, actual javascript) it has far and away the best combination of safety and ease of integration with javascript libraries.
We love coffee script's syntax but the type safety of TS has become a must-have that we can't live without.
Typescript, once you start adding annotations, does actually combat some of the bigger warts in JS. specifically erroring on wat-ops like 1 + "" vs 1 - "" or [] - "".