Make it feature complete and you'll get the same speed the browser has.
If we're going to build a new rendering engine for the web, maybe we could try to create something nicer than HTML and CSS, whose only advantage at the present is the number of developers familiar with it. I know I wouldn't miss them.
Yep, the model of HTML-CSS-DOM-JS implies extreme overhead, and only heroic efforts and thousands of man-years of work and optimization have made it bearable.
I'm saying this as I have compared the performance of a simple local web page with a simple view with the same exact functionality rendered with my pet naive unoptimized UI engine and the latter was blazingly fast compared to HTML.
So I guess you are right, we definitely need something less cluttered and more efficient than HTML+CSS+JS.
Compare how easy it is to make web pages with just HTML+CSS+JS, especially for a beginner, with any other framework, native code or no. The separation of structured markup, display theming, and custom logic is remarkably powerful, and everyone saying otherwise is just plain wrong if you look at history.
Once you start doing anything outside of your simple page with a simple view (which was what, incidentally?), your engine starts to accrue features that move it in "bloat" towards a modern web browser.
The link mentions "Hey, this is really useful on mobile"--and I would consider that a failing of the mobile vendors browser teams, not a problem with the web.
This looks really flashy for the sort of static content + basic animations + interactions the author is showing off, but once you start handling further interaction--like, you know, building a virtual dom to render to the webgl texture, all you're doing is reinventing the facilities the browser already gives you, but instead behind one more layer of abstraction.
Well, I'm a beginner in web, and I can't say it's easy, in fact, it's quite the opposite. In native frameworks there's normally one idiomatic way to do things, while the web framework land looks terrifying.
Actually, my pet UI engine was powerful enough so that I've implemented a complete mobile application in it. I'd also tried HTML, but it just wasn't competitive. The native iOS UI was even faster and was miles ahead of HTML in terms of speed.
Also, there is such thing as Qt Quick, where you can basically write in reactive JavaScript, it is at least as powerful as HTML-CSS-JS, and it is still way faster.
The web has started from something that obviously wasn't designed for performance and has come a long way of incremental evolution. Given this, and given that I know how hard it is to make a fast UI engine as powerful as web, the current web performance is actually spectacular. But still, there are better models, and there can be even better models.
Well, I'm a beginner in web, and I can't say it's easy, in fact, it's quite the opposite. In native frameworks there's normally one idiomatic way to do things, while the web framework land looks terrifying.
So, that's part of the problem, right? For some damn fool reason we keep throwing beginners at frameworks--they should be starting with just bsaic HTML and CSS, and then learning JS, and only then moving on to frameworks. It's so damned confusing in part because people aren't learning the fundamentals, and so are lacking a mental model of how things work and what makes them slow.
I'd also tried HTML, but it just wasn't competitive. The native iOS UI was even faster and was miles ahead of HTML in terms of speed.
Show me some numbers. If you want to talk about performance, then let's be quantitative. I'm also willing to wager that the HTML on the mobile device was full of bits you didn't need.
But still, there are better models, and there can be even better models.
Again, why do you think this is the case? It's worked, with expansion, for over twenty years. That's a staying power few technological approaches have--maybe, there's something to it. This notion of "better models" really frequently boils down to "I have this one specific thing I need done, and anything that doesn't match this one specific thing is superterribad and clearly needs replacing."
If you want the best performance (which honestly probably doesn't matter that much for your use case), write things in native code as you've done. But don't then pretend that that is a valid yardstick to measure an entirely different tech by.
Absolutely this. The first sentence. Part of the problem is the vast echo chamber of Stack Overflow, where every JS question gets a jQuery/Express answer, even when the asker explicitly asks for vanilla JS help. Having hired developers in the past, this is probably my biggest pet peeve about web developer culture: Everyone seems to start from the top and only maybe work their way down through jQuery to vanilla JS. One of the questions I used to ask in interviews was to do some simple DOM manipulations without a library. This is a kind of fizzbuzz, as I'd guess probably 80% of the interviewees could not perform such basic JS functions as DOM element selection, which boggles the mind (even considering that the primary function of jQuery is its selector functionality). Certainly this experience has completely validated every claim I've ever heard about most developers not being hackers. As someone who yearns to learn in the most hardcore way (e.g. reading language references at the beach), I cannot fathom how so many people interested in writing code do not also possess the drive to tinker with (or at least wonder about) the inner workings of their tools.
Those reading specs interview those who say specs are irrelevant (same applies to basic (and advanced) math, seemingly) -- is not that satisfying, after all? ;)
For some damn fool reason we keep throwing beginners at frameworks--they should be starting with just basic HTML and CSS, and then learning JS, and only then moving on to frameworks. It's so damned confusing in part because people aren't learning the fundamentals, and so are lacking a mental model of how things work and what makes them slow.
Actually, I've been familiar with HTML+CSS+JS for a long time. The vanilla web is just not very practical for creating full-fledged web apps, especially given that there are so many frameworks that have a lot of things out of the box. Also, the vanilla web misses some features that are essential, such as the reactivity (binding).
Show me some numbers. If you want to talk about performance, then let's be quantitative. I'm also willing to wager that the HTML on the mobile device was full of bits you didn't need.
The last time I tried you wouldn't need numbers, as my pet engine did steady 60 FPS full-screen animations, while the iOS web view pathetically presented something closer to a slideshow, Android did better, but still not smooth enough. And the page loading was visible instead of instantaneous display with the native stuff. Of course, faster devices alleviate the problem.
>But still, there are better models, and there can be even better models.
Again, why do you think this is the case?
Because I've developed my own thing similar to what HTML+CSS+JS do, and I could clearly realize that you can do the same things with a much simpler model that also happens to work faster. Also, there are existing native frameworks that are examples of this.
It's quite clear that the web wasn't originally designed to be used how it's currently used and practical web apps are built with basically hacks over hacks and hack-based frameworks. Obviously, getting rid of all that clutter accumulated by incremental evolution would make a difference.
Dude, don't be so shallow. You'll be surprised, but HTML, CSS, and JS are not the web. To realize this simple fact, you can try looking up the statistics on the number of websites made in vanilla HTML/CSS/JS, or see how many there are the 'Vanilla HTML/CSS/JS developers' out there. That means, if you only know HTML, CSS, and JS, you can't make practical web apps, and you can't be a web developer either.
I am familiar with HTML, CSS, and JS, but can't make anything except the simplest static website.
It remained in the commercial mobile app I'd used it for, and it's not my intellectual property anymore. There isn't anything ingenious about it anyway.
My point wasn't about how good my pet engine was (because it wasn't), but about the fact how the overcomplicated model of the HTML-CSS-DOM-JS makes it so hard to optimize web page rendering that even an unoptimized prototype UI engine outperforms the browser.
I am amazed by the people who develop browser engines because they do something almost magic of fitting that monstrous dynamically modified DOM into so little memory and making it so fast.
I conjecture that in a naive unoptimized implementation a web browser would consume gigabytes and took a couple of minutes to load an average page.
When beginners start strutting around acting as if their "framework" or approach is better than the norm, the sceptic in me comes out to play. The likelihood of them actually having found a better way is pretty slim. Sure it happens but not everyday.
I agree that in theory, that separation is sound. But in practice, it seems no one uses it like that, and we find ourselves constantly fighting against that purity. e.g. adding extra divs just so I can center one bit of text the way I want to.
I am sorry if I sounded rude, I didn't mean to knock this particular project down.
I was commenting on a hypothetical future for something of its kind, and that I think HTML content is not really the way to go to make shiny WebGL things, IMO.
To be a little more on-topic, yes, as an "apply shader to this semi-static div" it is a pretty cool thing :)
That's the opposite direction you want to go. At that point, you might as well just use HTML. I think there are benefits to providing a subset of HTML features that you can tailor for super fast performance.
Almost any native UI framework (iOS, Android, WPF on windows, etc) has better layout options. Some of them like iOS have options that are not as beginner friendly (AutoLayout), but they are still better overall if you are trying to develop an application instead of formatting a document.
Many other UI frameworks have had Flexbox type layouts, a technology W3C has only just recently realized is a good idea for 8+ years (probably much longer).
But there are serious known bugs in IE10 and IE11 flexbox implementations. They will never be fixed, so when IE11 market share drops below 5% I will use flexbox. We're talking about perhaps in the year 2020. HTML/CSS is still not suited for app development and due to browser inconsistencies that will remain true for decades to come, perhaps forever. Apps in browsers is doable, but a more cumbersome than one might think.
Your browser is slow when applying transform to DOM elements because it has to translate everything 3D in terms of JavaScript and DOM. If you want to manipulate images and elements effectively in 3D then you have to learn matrix computations, quaternions and stuff which is horrible for the common web developer.
I'm saying that if you offer a new approach that could mix HTML/CSS and encapsulate those complex 3D concepts it would be interesting.
If we're going to build a new rendering engine for the web, maybe we could try to create something nicer than HTML and CSS, whose only advantage at the present is the number of developers familiar with it. I know I wouldn't miss them.