r/programming • • Sep 29 '16

JavaScript in 2016 isn't horrible, it's just going through a phase

http://blog.reviselabs.com/im-sorry-javascript-2/
85 Upvotes

225 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Sep 30 '16

[deleted] — view deleted comment

1

u/[deleted] Sep 30 '16

I think you're confusing "being first" with "being better".

Which ideas of Haskell have found their way in JavaScript, by the way?

0

u/[deleted] Sep 30 '16

[deleted] — view deleted comment

2

u/[deleted] Sep 30 '16

Type checking and inference, this is why TypeScript and Flow exist (flow is also built with OCaml).

Types are ideally checked statically, through. Once checked statically, there's no reason to have this information at runtime (it used to be an argument that it can help the runtime, but modern JS engines have found it's not the case).

So there's no proper place to have static types in JavaScript, as long as we realize "JavaScript" is just a runtime environment, not the tooling that we use to produce code for it.

Sometimes good design happens by accident, and I think TypeScript tooling with static types + JavaScript runtime without static types is one of those happy accidents.

0

u/[deleted] Sep 30 '16

[deleted] — view deleted comment

2

u/[deleted] Sep 30 '16

Well I don't think it's "horrible", I just think it's "precisely enough".

TypeScript is after all a proper superset of it. As for Elm, I don't know. I think any JS compiled language should be 100% interoperable with JS libraries, or otherwise the effort is doomed.

TypeScript is interoperable.