How long will JavaScript continue to dominate?

In five years JavaScript, and many other similar languages, will be considered obsolete. I don't mean gone, JavaScript will be around for decades because there are hundreds of millions of lines of code working fine, and not worth the bother of rewriting. What I mean by "considered obsolete" is that people will no longer prefer that language, and feel more productive using a different one. JavaScript is 20 years old and has numerous flaws that cannot be fixed without major surgery, and from a compatibility point of view it would be very difficult to correct without breaking hundreds of millions of existing lines of code. Node.JS is merely javascript running on the desktop instead of inside a browser; that isn't a technological shift, but merely a platform spread (if you consider as i do that the web browser is its own platform independent from Mac OSX, Windows, Android and iOS which are the main client platforms).  A language with a fresh approach will arrive, that uses a deductive model of computation. This next generation language will also offer very strong compile-time integrity/logic checks to assist the programmer in delivering reliable software. Reliability is the great unsolved problem in computer science, not the ability to handle large amounts of data. And by reliability, i mean errors in software caused by human mistakes. Computer hardware is incredibly accurate and repeatable, but look at our main operating systems: hundreds of thousands of unsolved, unrepeatable problems reported with no resolution in sight.

People are writing software at all levels today, from low-interactivity spreadsheets to 3D computer games. All of these tasks are plagued with bugs.  We are in a period of time like the early automobile, when your chauffeur was also your mechanic because the car was very likely to break down. Today software is being delivered, but you have to keep a maintenance programming staff around forever because you are afraid it will break down, and it takes so long to understand someone else's work that you dare not dismiss the already trained maintenance staff, even though they may be lightly used. This high-cost-of-maintenance paradigm has to go away, and just like in automotive history the mechanic has become much less frequently accessed. We have come a lot way in the computer business; it used to take 30 minutes of a skilled technician to just turn on the mainframe computer, and now our cellphone computers can update themselves and rebooting takes under 1 minute. But we also have a long way to go. 

JavaScript is the dominant language of the web today, because it was selected by a staffer at Netscape, and the other browser companies agreed to implement it with an acceptable level of uniformity. The entire HTML5 stack is riddled with fatal, intrinsic flaws, that no minor twiddling by the committee can possibly fix. To imagine future generations (5 years is like a distant point in the horizon in technology space), would continue to use the crude tools of today, is a grim prediction. I have a more optimistic view, that the current languages will be swept away by a far superior language and toolchain.