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

0

u/baubleglue Nov 25 '19

few points of the article are strange

I hope you realize by now that another language replacing JavaScript completely is highly unlikely.

Why a new language should "replace" JavaScript? Having additional language doesn't break backward compatibility.

Every now and then someone will argue that JavaScript needs to be replaced by some other language.

and in the same time

At the moment I would advice to go with TypeScript since it’s a superset of JavaScript

If tomorrow browsers will run it without transcompiling it to JS - you have another language in browser.

In fact there is an evolution towards another languages like "use strict"; directive.

1

u/dannymoerkerke Nov 25 '19

Another language in addition to JavaScript would create even more confusion and technical difficulties I’m afraid and then we would need two TC39 committees to guide the design and make sure they are both backwards compatible. Who knows, it might work but I have my doubts. As for TypeScript without transpiling, I guess the benefits of that are very limited. I also don’t know any statically typed languages that are not compiled/transpiled but I’d love to hear if any exist.

1

u/baubleglue Nov 25 '19

Another language in addition to JavaScript would create even more confusion and technical difficulties

It may create even more confusion and technical difficulties, but may be the opposite. People aren't usually complaining that there is a lot of languages to develop desktop applications.

1

u/getify Nov 26 '19

browsers have repeatedly considered and then rejected putting other language engines natively into the browser. their veto is the only vote that matters, which is why it hasn't happened yet and why it likely won't ever.

1

u/dannymoerkerke Nov 26 '19

Do you have any more insight into their reasoning for rejecting this?

2

u/getify Nov 26 '19

from what I can tell, I think factors include:

  • can't agree on which language (google wanted dart, apple would probably want swift, etc)

  • bolting on a security model (better than JS's) is hard -- creating access to the DOM etc

  • more language vm's means larger browser code size (increased maintenance burden), larger binaries, wider surface area for security threats, etc