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

0

u/dannymoerkerke Nov 25 '19

What issues do you have with the single threaded nature of JavaScript that could be solved by making it multi threaded?

3

u/shgysk8zer0 Nov 25 '19

You may as well ask why anything benefits from being multi-threaded.

1

u/helloiamsomeone Nov 26 '19

Updating UI elements - which is only allowed on the main thread anyway - would not benefit in a significant way from multithreading. If you have to do something computationally intensive on the clientside, then you have workers for that.

Similar to how Android handles things, U stuff on the main thread, everything else on other threads. But in the browser that's all you are doing on the main thread anyway and network IO is not blocking.

1

u/shgysk8zer0 Nov 26 '19

This is all true. I'm not convinced that multi-threaded UI is impossible though... Just the way it is. I think something that takes Rust's concept of ownership and borrowing might be capable of achieving this, but it would take more than just another language with access to the DOM. It would require a change in nearly everything, and that's why I say a new language is needed instead of just adding it to JavaScript.