You Might Not Need TypeScript (or Static Types)
Eric Elliott

Eric Elliott, you just listed my most frustrating moments from the past almost year of moving from using Node.js to a statically typed language, namely Go:

Specifically, static types can make all of these things harder (not impossible, just more complicated than they need to be):
Generic functions & polymorphism
Higher order functions
Object composition
That’s a drag, because I use all of those things a lot, and if you’re a fluent JavaScript coder, chances are good that you use them a lot, too.

I thought that having static types would be a huge benefit for rest APIs:

I was wrong.

I thought that because Go has first class functions, it would be easy enough to do some basic functional programming in it.

I was wrong. Because of Go’s extremely simplistic type inference and lack of generics, using higher order functions is an exercise in frustration. It is currently impossible to implement a generic map/reduce/filter in a type-safe way, and that is extremely disappointing because, as was said above,

I use all of those things a lot.

That being said, I still would love to really learn Haskell since it’s a true functional programming language with static type checking but without the syntax noise (in function declarations at least) of other languages. Still, one of the things I find most confusing in Haskell is the plethora of operators on its various types. It’s ironic because those operators are just functions with really bizarre names (`>>=`, `<+>`, `<=>`, `$` ), but they read like additional syntax.

For now, though, my go-to language is JavaScript.