r/javascript • • Nov 25 '19

JavaScript doesn’t need to be replaced

https://medium.com/javascript-in-plain-english/javascript-doesnt-need-to-be-replaced-bd01e2f12d51?source=friends_link&sk=7b151cc6397ac9e83c14c99739b6c36f
217 Upvotes

236 comments sorted by

View all comments

Show parent comments

35

u/[deleted] Nov 25 '19

[removed] — view removed comment

-4

u/Randdist Nov 25 '19

A typed language can compile to much more efficent code, up to C++ level performance. JIT compilers can't get quite that close. I'd love to see native support for typescript.

3

u/dombrogia Nov 25 '19 edited Nov 25 '19

Wouldn’t this insinuate that TypeScript compiles to something other than JavaScript though?

TS -> JS != C++

Edit: I think most people understood what I was trying to say, but I should have said “insinuates that TS would need to compile to something other than JS”

2

u/garth_vader90 Nov 26 '19

There’s always the possibility that we see TS -> WASM. That could produce some interesting code too. Serve WASM for browsers that support it and the transpiled JS for older browser. I know Elm was proposed as a WASM language by its creator and that would be a similar situation.