Even on the backend, in the end you have to run native machine instructions. HTML/JS/CSS substitute for that on the front end. Of course, x86_64 may be a better compile target, but the advantage of the existing languages over any new system is that there has been a lot of work that has already gone into making them fast, backwards compatibility, all browsers already implement them, and there are a lot of things that can target them now.
See also: https://www.destroyallsoftware.com/talks/the-birth-and-death...
Compiling to js is ok as that language is as close to the metal as you can get on a vm anyway. So long as performance isn't affected then it's really no different to the developer. Still the platform would be more elegant if it didn't compile to some intermediary high level language.
JavaScript is as low as the metal you can get in a Virtual Machine? hmm...
"Apart from syntax wins, you can't get much lower-level semantically and keep both safety and linear-time verifiability. Java bytecode with unrestricted goto and type confusion at join points makes for O(n^4) verification complexity. asm.js type checking is linear.
New and more concise syntax may come, but it's not a priority (gzip helps a lot), and doing it early makes two problem-kids to feed (JS as source language; new syntax for asm.js), which not only costs more but can make for divergence and can overconstrain either child. (This bit Java, pretty badly.)"
Either way, WebGL/canvas operate as child elements in an html page, you still need to use javascript, and SVG isn't GPU accelerated. It's still, overall, an ugly mess. But definitely, with improvements, canvas, svg and webgl are all candidates for my aforementioned "next steps."
Imagine your operating system can only compile one single language: Perl. And with perl the only way you can render anything on the screen is with a QT api and QT UI primitives.
Programmers can still do anything within this ecosystem. Technically you can have perl as compile targets for any other language. Lets also pretend that QT has this little UI element called canvas that has a api allowing you pixel level control.
While technically you could do anything in a platform like the one I described above, I'm sure you can easily see why it's still bad.
That only works if your abstractions don't leak and your libraries are stable enough so that you can avoid having to debug on the lower level anyway.
It might be bad example, but if the Java SE runtime libraries was just a dependency like any other mvn artifact (module), Sun / Oracle would for example have been in a position to introduce immutability to the Collections framework and fix crazy other stuff[1] without breaking backward compatibility. But now we are stuck with those legacies forever[2], since they standardized on a too high level abstraction and choose fewer layers. For Java's, luckily they had layer underneath - JVM byte code, which is why I predict Java is still relevant for many years going forward.
The next generation of WWW needs to a very low common abstraction, e.g. bytecode. Something similar to X Windows.
[1] See Effective Java Puzzlers. [2] Project Jigsaw might change that.
Or would your byte code blaster have similar properties?
Java Applets, Flash, SilverLight always was at a disadvantage, not being native to the browser runtime. Startup time and the need for a "plugin" hurt them. And they all kinda sucked in their own way. I hoped for a long time that Dart / native DartVM to Chrome could make a stride, but sadly they were fighting uphill battle against the sheer volume of JS developers resisting change. I'm convinced that it's never about the language[1], but the VM and it's abstraction layer. We need a layer that we can compile JavaScript(/HTML/CSS), Scala, Haskell, C#, F# etc. down to, not more languages.
I wonder how many man-years has been wasted on vertically aligning div's inside a div. :)
[1] Guy Steele, amazing talk on "Growing a Language", https://www.youtube.com/watch?v=_ahvzDzKdB0
I'm building this. I've been working on a side project that was my idea of the ideal internet platform, and for a long time I believed that the front end was a lost cause. I've recently figured out the solution. Had quite a eureka moment, in fact. This will be open source but it may be a startup and I'm not going to talk about it until I have a proof of concept... but let me give you an overview:
-- Works on all browsers made since 2013ish
-- You can do absolutely anything you want, in any language you want (though a bit of glue will be necessary to a lower level framework)
-- Initially there will be a basic implementation on a well known and well supported development platform that will bring this close to WYSIWYG and let you write code in more than one language
-- There is a spec for UI elements and you can throw out that initial implementation and write your own complete implementation. This is a non-trivial project, but much easier than creating a browser.
-- The UI can be easily implemented in native forms for native applications. So the "page production code" can be the same for all platforms, web and native, and the "client" code merely translates into the local platforms UI elements (or re-creates the spec's UI elements when there isn't a mapping.)
-- It might suck. This is highly experimental right now.
-- It's no longer a side project, it's my full time obsession.
If you're interested in this, follow: https://github.com/nirvana/nirvana or @NirvanaCore on twitter. Or if email is your thing, check out http://nirvana.io
(ignore what's in that repo right now, the work is happening elsewhere until it's usable for people to start building stuff with. At that point it will be easy enough to wrap your head around that outside contributions will be appreciated. I have a group of hackers I'm working with now, and it's clear things aren't far enough along... yet.)
A more ideal VM would be one which doesn't force a particular paradigm on you, but just abstracts over the CPU, using capabilities to restrict which instructions can be invoked. The CLR lacks such capabilities. Perhaps something like SafeHaskell would be in the right direction, where side-effects are limited, and the user can optionally allow websites to invoke trusted modules.
With the browser everyone is stuck with one universe. The only thing that changes are front end frameworks which offer some flexibility. Still, if html sucks we're stuck with it. If you hate html or javascript then you hate the entire front end. You exist outside of that universe because Nothing can change it. End of story.
I don't know how it could be done while keeping things secure, but it would be awesome if the browser universe was as flexible as the backend. If I could swap between html and any other kind of media based declarative language as easily as I can swap between python and ruby on the backend, it would change the face of frontend development and make it more accessible. In fact what if I wanted to develop my own language that interfaces with the rendering engine? The browser should permit that, because the Web is too broad to be dominated by a single language(HTML).
I think this should be the next step.