I tried your code snippet on my inferior Windows OS and inferior IE Edge browser. The tab stopped functioning. I opened a few other tabs and continued to work. Eventually IE showed a notice that the tab had stopped responding - I had the option to close the tab or recover the webpage. I clicked 'recover webpage', the page was refreshed and I could continue using it. Truly, Javascript is eating the world.
Or perhaps the language has nothing to do with your problem.
Re:JavaScript is Eating the World
by ghostbrainalpha on Thursday August 24, 2017 @12:32PM
(#15091527)
You have me curious. Why would you run IE Edge instead of Chrome?
Re:JavaScript is Eating the World
by tedunangst on Thursday August 24, 2017 @01:05PM
(#15091882)
Edge support for touch screens is considerably better than chrome.
Do you deny that implementations are part of the language? If the Javascript specification left this out, what other implementation gotchyas exist for them to exploit?
Few but you likely consider the implementation part of the language.
C explicitly states what an implementation should and should not do. The same with C++, FORTRAN, and other standards. Javascript is a standard written by committee. So why can't it tell implementations what is good behavior and what isn't? Other languages do.
I think there's a distinction to be made between the language spec (e.g., interesting Javascripty details like what is the result of `"" + 1`) and integration issues like what to do when the browser window detaches, how many threads the browser will devote to running Javascript, what to do when some of those threads appear to be blocked, or how should the runtime/VM attempt to recover from deadlock or OOM.
Count me as one of them.
The implementations are what matter. They're the only thing that matters. It's the business axiom "Ideas are worthless, it's the implementation that counts" at work.
Ask yourself this: If V8's performance was still at 2010 levels, would Node exist?
And if some other language were the one which had been picked for browsers - JavaScript relegated to only running on servers - I wager JavaScript would hardly be used at all.
V8 is a good runtime implementation for a pretty weak language. Personally I don't think node's existence is a net positive for the world. Ask yourself if we'd be farther ahead if the browsers of 20 years ago ran Perl instead. Anyhow, this entire thread already supports the two ideas that (1) implementation is hugely important and (2) not all issues are language issues per se.
How is CPython not a part of Python? After all all Python implementations are always, always compared to CPython
Language != implementation
Language != compiler
Language != library
Language != SDK
That being said, JS sucks for large projects.
Javascript is just the language. Its your runtime environment (browser) that is letting an unprivileged process consume resources like that without killing it.
Re:JavaScript is Eating the World
by curtisblaine on Thursday August 24, 2017 @10:22AM
(#15090311)
And it seems, his operating system allowing the browser process to take all the CPU.
Re:JavaScript is Eating the World
by AlexeyBrin on Thursday August 24, 2017 @10:39AM
(#15090439)
I would argue that all modern Operating Systems have dark corners and hidden bugs. It is just a question of time until you hit a similar bug on any OS.
I had a similar experience on macOS with Chrome Canary watching a YouTube movie full screen. My laptop simply froze, nothing, except a restart, worked.
Re:JavaScript is Eating the World
by curtisblaine on Thursday August 24, 2017 @11:21AM
(#15090821)
Perfectly happy with the existence of OS bugs. As long as they're not used as incorrect evidence to criticize programming languages.
Re:JavaScript is Eating the World
by TrickyRick on Thursday August 24, 2017 @09:53AM
(#15090098)
I would have thought that all competent browsers run tabs in unique processes.
That's what I thought too. I think the process was so locked up in executing the code that it perhaps didn't respond to the kill message?
I was an idiot, but at the same time, an unprivileged process should not be able to consume resources like that without a dæmon coming in and pausing/killing it. And the Javascript should not have been allowed to execute once I had closed the window.
Truly, Javascript is eating the world.