525 points · by methyl · 6y ago · 321 comments
They started out as an SVG engine for set-top boxes (embedded devices running on TV's) since browsers at the time weren't fast/light enough for the underpowered chips in set-top boxes. Then when the devices got better chips, they realized perf still wasn't good enough for big 4k screens – and that multicore rendering could help.
So they've implemented a full HTML/CSS/JS browser from scratch, all to take advantage of a multicore architecture (today's browsers all render on a single thread) which has enabled (they claim) greater than 4x better framerate during web animations than the stable channels of Chrome/Blink and Safari/Webkit. Oh, and 60% faster layout on a quad-core machine.
They also claim "extremely low memory consumption", which would be quite appealing to many HN'ers I think, though that may only be true of their HTML engine and not of the full browser (eg; when using multiple tabs and hungry JS apps).
"What would you do if you had 16GB of RAM?"
"I'll tell you what I'd do with that. 2 Chrome tabs at the same time."
(Superimposed over the scene from Office Space.)
(On a more charitable note, I worked with the Chrome performance team on a few occasions. The reason for Chrome's massive memory requirements is that they make memory vs. CPU/performance/security tradeoffs on a regular basis, and usually make them against memory. For example, the reason you can have smooth animations in Chrome is because there are multiple in-memory representations of the layout and changing a CSS property relies on cached parsing/cascading/layout decisions and only needs a repaint on the GPU, using blocks of the page that have been pre-rendered into a texture. For another example, the multi-process architecture that gives each webpage isolation from another is a lot more RAM intensive than a shared-state architecture that could share common components, like say the object code from compiling shared JS libraries.)
Do they actually test both approaches, or is it more a matter of "we can code it way A or way B, and way A uses more memory, but we think it'll be faster"?
Many years ago I worked at Watcom, back when they made "the" C++ compiler for DOS games. (Doom, Descent, Duke Nukem 3D, and Tomb Raider all used it.)
The compiler had various optimization settings, and some optimized for size, while other optimized for speed. The compiler was used to compile itself. They normally compiled with the "optimize for size" settings enabled, but one time they decided to try optimizing it for speed to see how fast it could be.
It turned out that optimizing it "for speed" made it considerably slower because of the cache.
This is generally a good trade. Memory is not very useful (modulo filesystem caches) when you're not using it, and has a very low cost when you are (extremely tiny power consumption). CPU cycles cost power (leading to heat dissipation and battery life loss) when you use any amount, and latency when you use too much. Latency directly affects user experience and efficiency, which is a much higher cost than "my RAM is at 75% usage".
Additionally, Chrome's tradeoff is such that it works out better on cheaper devices. Memory is far cheaper than more powerful processors - which also reduce battery life, which is even more expensive. On more expensive devices, you have all the memory you need for Chrome anyway, so you're just getting better latency.
Finally, there are very few cases where you should have a large number of Chrome tabs open anyway. Multi-tasking is impossible (the human brain simply doesn't support it) and rapid context-switches are inefficient. As much fun as it might be to have 5 tabs open on each of 10 different topics, you're simply decreasing your productivity and capacity for focus. Even when doing multi-disciplinary research, there are a ton of ways to get around the problem of running out of memory due to Chrome tabs: printing pages to PDF, turning off JavaScript, downloading research papers and reading them in a native PDF viewer, extracting content from webpages and inserting into local documents, and the classic using darn bookmarks instead of tabs like they were intended to be used.
(of course, in an ideal world, all web browsers would use absolutely no memory or processing power whatsoever - I'm just defending this particular engineering tradeoff)
I can't even scroll Twitter without stutter on my hefty gaming laptop, my browser (the whole thing! not just the tab!) often freezes for 10+ seconds when first rendering a page, and toggling Reddit's sidebar takes half a second.
To the extent Chrome's anything can be deemed ‘smooth’, it's because computers are fast, not because they made some clever space-time trade-off.
EDIT: someone in this thread posted this:
I can't even scroll Twitter without stutter on my hefty gaming laptop, my browser (the whole thing! not just the tab!) often freezes for 10+ seconds when first rendering a page, and toggling Reddit's sidebar takes half a second.
This explains a lot, I (almost) never visit twitter or reddit.I can run Intellij Idea: Java IDE, load project with thousands of files into it and it won't eat 8 GB.
I understand that Chromium is maintained by extremely talented developers and all obvious improvements were made, so that memory usage is probably necessary. But I still wonder how is it possible. Gigabyte of RAM is a lot.
But yeah, 8GB is unbelievable. I have no clue why Chrome needs this.
I don't have the same experience, PyCharm is absolutely killing my machine and I always have it in Power Save mode. Sure, it isn't eating 8GB but that is because the JVM by default doesn't have that much available. I had to raise the memory limit considerably to be able to open my projects without it hanging.
It's kind of obvious and does not at all explain chromium's lower bound of memory usage. But: if Chromium runs better with more memory and no other process is using it: please take it!
That is what it's there for, after all.
Gnome and KDE folks. Although I stopped using either of those so I don't care.
I keep obsolete computers and phones around to test with.
This is called Wirth's Law: Software gets slower faster than hardware gets faster.
Pretty much the only thing we've seen it stutter on is browsing very high res images taken with a high end camera off of a USB stick.
So that's about architecture of the Chromium - multiple processes (not even threads) and IPC between them to render stuff.
Thats why on iOS safari if you scroll fast enough you see a checkerboard pattern... that means that tile isn't yet rendered...
The JS is SpiderMonkey, the rest indeed is written from scratch: https://twitter.com/flowbrowser/status/1200098712816631809
Might be nice as an Electron replacement
I have spent hours searching the web for any clues as to Microsoft's intentions here. I would be grateful for any words on how you came to believe this.
Kudos to the author.. but I was hoping it would be a "for real new" browser.
There are some weak points for web. One of them is performance, hopefully it'll be resolved by Webassembly, so you could write performance-sensitive portions using C++ or Rust. Another one is using hardware and that's resolved by evolving web standards like WebUSB, WebGPU and so on. I don't think that replacing HTML, CSS or JS with something different would solve any actual problem in the web. They are not ideal, but they are good enough and that's all that matters.
Well, technically you could replace JS with any other language compiling into JS or Webassembly. Then you could just use one full-screen canvas and draw anything you want there, so you could use Qt or something like that. That does not require any new APIs, but I don't think that's the good idea in the long run.
To be fair, CSS is making big strides in this regard with Houdini[0]. It's not yet complete but it's a much better alternative to composing divs and spans in weird ways to get the look you want.
However, I think the need to support the current web stack will continue for the foreseeable future since it would be a terrible waste to simply abandon a platform that so many applications are written for.
So much tech today is being built just to put a band-aid over this stuff, instead of addressing the core issue (the browser is no longer used to just deliver static documents). I can't be the only one that wishes for a new language/browser. WebAssembly might be a saviour, although I'm unsure how issues like accessibility will be addressed.
I don't do native software development but just looking at things, it seems like software is eating the world, but also at the same time that web technology is eating software development.
I don't think the web is the best development tech on any OS, but it's proving to be the best cross-platform tech that runs on any device. It will continue to evolve to be more suitable, but the idea that it's too weak or wrong is exaggerated.
Looking at what web browsers are both capable of and expected to do today I think what we really want is an "internet terminal" which would be able to contact resources over the internet, negotiate both local and remote resources for an intended purpose, and then share state bi-directionally (stateless is just zero state).
To just conjure a couple of quick examples you can imagine the differences required in providing a service that produces a simple JSON feed versus a full interactive experience that mutates a shared database. The JSON feed wouldn't require a display and could easily be consumed by autonomous agents while the other might require a minimum display size and want to use a widget set to produce controls and toolbars, etc. If my client agent is allowed access to my video display, mouse, and keyboard it could offer these to either service and allow it to respond in whatever way it feels appropriate. The JSON feed could provide a simple UI for viewing recent events, for example.
Now we do all of this today with HTML, CSS, JavaScript, etc. but none of it feels organized and all you see is re-invention after re-invention of essentially these same concepts. The fact that we even call them "applications" when they are "documents" is really what seals it to me. I personally would like to see something that is more true to the reality of computing and internet connectivity today and looks at it from a device-to-service POV. Locally I might have a graphical display, audio, and inputs but I might also have access to an SQL database or some other network-attached service. Assuming some level of trust and if negotiated properly there's no reason a remote application couldn't make use of these local resources using credentials and security profiles under my control. The can of worms here is that this is basically RPC which is the other never-ending disaster...
Internet is hard. Let's go shopping.
Scoped CSS works really well in conjunction with web components. Languages like SCSS make everything more sane, especially in combination.
I'm currently messing about with Yew[1], which is an entire SPA framework in Rust/WebAssembly. There's about 5 lines of bootstrap JS involved (and fiddling about with bundlers, which is much more sane since Rollup[2]).
[1]: https://yew.rs/docs/ [2]: https://rollupjs.org/guide/en/
The web is a mine-strewn no-mans-land between competing factions, which accounts for a lot of the strangeness.
(Ironically, the tech is leaking in the other direction as web apps become more popular on both mobile and desktop)
This works if browser is the only application that runs on machine. So this is limiting possible use cases (like Electron) quite a lot.
> low memory consumption
Sciter's Quark (https://quark.sciter.com) - 5 MB binary and 28 MB RAM by default is probably the lowest what you can get for HTML/CSS/script engine.
I don't understand what you mean - individual applications within a multi-application system can absolutely utilise multiple cores. It isn't true that it won't work. The kernel schedules all the tasks of all applications across the available cores.
And even if you have many applications running, most of them don't need multiple cores all the time, so it makes sense for each application to be able to use as many cores as possible, when the user is looking at it and doing something.
For example if I'm using my text editor and browsing docs. My text editor only needs tiny a fraction of a core every now and again, but each time I navigate it'd be great if the browser temporarily used all sixteen cores to do that as quickly as possible.
The only reasonable option for UI rendering these days (high-DPI monitors) is to delegate rasterization to GPU. CPU is for running application logic. If you would do UI on CPU then this will be the only task your CPU will do. E.g. animations require stable frame rate (60 FPS or more) so UI must run on highest possible priority on your OS.
That doesn't even run standard HTML/CSS/JavaScript. That fact alone would make me completely ignore it for any possible application.
But if you just need to create some relatively small utility, let's say, calculator.exe then it is pretty adequate for the task.
If you want to run something that is designed for Web browser then you need browser and server (Electron or Atom for example).
I wonder how WPE [1] compares to that.
Sciter is a really cool technology. However I've always wanted to ask you - do you ever feel that your deviation from standards has reduced your market? I was considering Sciter for a project previously, but ultimately decided against it because it required me to write two separate implementations for desktop and browser.
There's obviously benefits from deviating from HTML / CSS / JS, they're very much products of history. Sciter's native (and seamless) custom HTML tags, some built-in preprocessing, being more immediately feature complete, all just wonderful. I'd just like to hear your specific reasoning, though.
And if you're able to comment on it, how many people maintain this project? It seems like a huge task, but most of the discussions I've seen hint toward it just being yourself.
Finally, how is accessibility support? This seems like a big point, but it's not directly addressed in the documentation I've seen. In one forum post I saw you say that Sciter assigns some screen reader semantics based on a custom behavior tag in the CSS?
Just an example why that happens: Sciter got flexes and grid 10 years ago as they are the must for desktop UI. Web platform got them practically only in couple of last years. And it is simply to late to change anything - many customers rely on them. But its quite easy to solve this problem using @media sciter {...} sections. Features are easily transformable: https://terrainformatica.com/w3/flex-layout/flex-vs-flexbox....
Same is about script. classes, namespaces, symbols, async/await were in Sciter 7 years ago - I cannot change too much there. Support of existing customers is very critical for me.
> how many people maintain this project?
I did Sciter by myself only. Beside of customers there are three independent developers (Russia, Brazil and France) that requested and have access to Sciter source tree. I am accepting patches from them and customers. 3 AV vendors independently did security audit of the code. Yet Symantec (Norton Antivirus) provided Accessibility support implementation as for them Section 508 was the must.
These guys are obviously immensely impressive, but they're only one part of the chain. It frustrates me to this day that the UK market doesn't allow you to pick the DVB+IPTV STB you want and just expect it to work with any and all services.
That's not true anymore with webrender. It's available in FF for a while.
[1] https://www.ekioh.com/devblog/full-google-mail-in-a-clean-ro...
It's certainly not as compatible with the modern web as chrome and Firefox but hey, it's doing much more than I'd have expected.
>I’ll be the first to admit it’s not perfect yet – some vertical alignment is wrong in a few places, Hangouts doesn’t work, and our ‘contenteditable’ support is minimal. But I don’t think these detract from the achievement – as far as I’m aware, no browser engine other than Webkit, Blink and Gecko can run full Google Mail, and these have all had over twenty years of development work on them.
https://web.archive.org/web/20200613124642/https://www.ekioh...
A quirksmode post about the project: https://www.quirksmode.org/blog/archives/2020/01/new_browser...
And the project's twitter handle: https://twitter.com/flowbrowser
>Is Flow open source?
>It’s not. There’s no current plan for that as we don’t have a large corporation backing our development.
The world needs more browser engines (dang it Microsoft!), so seeing this development makes me really happy.
I've just started working on ACID2 compliance in my own engine a few days ago, and passing all three tests is no small feat :)
I don't think that's entirely true. It may have its own HTML/CSS rendering engine, but apparently [0] it uses SpiderMonkey for JavaScript. Still very impressive, of course.
[0] https://www.quirksmode.org/blog/archives/2020/01/new_browser...
https://i.imgur.com/ZW4BYH2.png
Now I'm curious to know which 3 features can be ignored by the dominant browser...
EDIT: Oh my, I suspected it was one of my extensions. Nope. Now I'm getting a "You should not see this at all" in a fresh Chrome guest: https://imgur.com/CrAYhpI
I burst out laughing because it was so unexpected. I wonder what's going on.
Wikipedia gives this as an example of a standard that changed: https://github.com/whatwg/dom/issues/319
Edit: there's an updated version at http://wpt.live/acid/acid3/test.html
> Wikipedia gives this as an example of a standard that changed: https://github.com/whatwg/dom/issues/319
That's the reason why tests 23 and 25 fail (both because of the "wrong" exception being thrown); https://github.com/web-platform-tests/wpt/commit/3cbdbaa7ca9... is the Acid3 change for that.
The other test that fails, test 35, is down to https://www.w3.org/Style/CSS/Tracker/issues/317; https://github.com/web-platform-tests/wpt/commit/e6f63a6e69e... is the Acid3 change for that.
(The reason they're simply commented out is it follows the precedent set by Hixie when he was still maintaining Acid3, c.f., https://github.com/web-platform-tests/wpt/blob/master/acid/a..., plus there are other feature-specific tests for those features in WPT.)
From the original blog post about Flow.
Browser makers seem to have this idea that if a feature is rarely used, it's fine to redefine or break it in the name of simplicity...
This makes me wonder if you could define a subset of those standards that would support 90%+ of the use cases, would be simple and efficient to implement and would be supported by existing browsers. You could then push this light version of the web as a new base for a future standard.
The problem would of course be that you would have to keep around a different browser to render old sites. Could still be worth thinking about. Doesn't seem feasible as a long term strategy to have browsers support thousands of apis and increasing.
Not really, you could polyfill the missing features like it's commonly done with many unimplemented new ones.
I'd prefer starting from scratch, with a completely new, simple language that can be translated quickly to HTML/CSS/JS. You'd have to remove those interested in being gatekeepers of the web and sabotaging any efforts to make browsers simpler from the W3C though.
What is conceptually wrong (or complex) with current HTML/CSS ? What would you change?
Though HN is all tables, and table layout is still largely undefined behaviour in the specs.
https://github.com/runvnc/noscriptweb
That GitHub project is just an idea and I am probably never going to actually code it because I have another side project. But I think the spec might be interesting to people.
Usually that is tested by using some older version of one of the major browsers, often IE11, but would be great to have a more well defined subset to target.
In fact 10 years ago it was such an idea at w3c-styles: https://terrainformatica.com/2018/12/11/10-years-of-flexboxi...
Single CSS property `flow` that defines layout manager in classic Java AWT terms: https://docs.oracle.com/javase/tutorial/uiswing/layout/visua...
Is Flow open source?
It’s not. There’s no current plan for that as we don’t have a large corporation backing our development.
This doesn't make much sense... why not simply say then "because we don't want to"?
Does it check flexbox and grid support for example?
https://web.archive.org/web/20200613124642/https://www.ekioh...
Of course it's faster than developing a browser from scratch, or working with a browser startup on integration etc. but that isn't the question. The question is whether it's even feasible to develop a browser with publicly available information (HTML 5 specs including SVG and MathML, but which one/version? tens of CSS specs and growing as we speak [1], hefty ECMAScript specs, http2+http3/quic, A/V codecs, multiple font formats, etc. etc.). As a glimpse into browser development, yesterday we learned [2] that even a RegExp engine for JavaScript poses a challenge, with specs being "fitted to match reality" eg Chrome behaviour. Honestly, with these results of creating almost a browser monopoly and driving browser development out of existence (Opera, MS), and now even Moz beginning to integrate Chrome code, I don't understand why the clowns at WHATWG and W3C even bother writing specs; they just can't stop it seems. Never has a standardization effort failed so miserably and went so totally out of control, and it'll be a huge problem for generations to come. Talking about almost all human communications (in law, education, politics, medicine, science, culture, personal docs) being held hostage by an ad company; even stone age humans had more liberties in cultural expression.
[1]: https://webplatform.news/issues/2020-06-04
[2]: https://news.ycombinator.com/item?id=23487960
Edit: big congrats to the Flow developers!
I'd say Apple falls into that category (although they don't solely depend on their browser, it is a major part of their ecosystem) - the day they stop maintaining Safari and just ship Chrome (or a skinned Chromium) on iOS and macOS is the day I stop using the Apple ecosystem.
if you wanted to publish a document, just ship some bytecode to render a document
want an interactive application? just use a bytecode library that renders controls and textfields etc
browsers then would become much simpler, and pages would just render themselves, meaning super old sites needing "quirksmode" would even be a problem....
i wonder why this never happened... what am i missing...
Chrome’s product management is all-Google.
Used to be that developers would decide between different browsers (or any other software really) and the rest would follow. Chrome/Edge/Safari bring built in to devices and being super hard to remove has changed that. All while not offering a better experience at all.
Big tech needs a couple anti-trust passes real bad.
You could even have Swift DSLs for type-safe markup and styles (I’ve actually been experimenting with building a Swift -> CSS DSL using simple protocols, enums, and structs) and, while we’re at it, introduce more sane defaults and cut some of the cruft that has accumulated over the years (do we really need HTML colspan attributes and CSS float when we can use a flexbox model?)
From the archived blog post
> Acid3 dates back to 2008 and the web platform specs have changed over time so a perfect score, using the version hosted on acidtests.org, is now only 97/100. The version hosted on the web platform tests site has been updated to match the specs and so, using that, browsers should score 100/100
AFAIK, it doesn't try, because their customers don't care.
> there won't be licenses issued to other browsers
That's… not really true. Google certainly are sometimes slow at dealing with Widevine licensing, but as far as I'm aware that's not a problem unique to the browser space.
I think that since web browsers have become operating systems it's just not feasible to implement a new compatible browser. ACID3 would just be the beginning, except now it's totally outdated.
That intractability of creating a new browser is why I proposed that we start over with something much simpler to implement that can actually perform.
First of all, to get to information quickly, the main browsing experience is markdown.
There is no more JavaScript.
Then media such as images and video are handled separately.
And finally, add some kind of simple Canvas-like or Framebuffer API to web assembly and have that available for applications.
Set limits on the amount of data per page. Maybe build in some p2p content distribution.
Something like the above could actually be feasibly implemented by multiple groups and would solve performance issues.
> 503
> Service Unavailable
> The server is temporarily busy, try again later!
As a feature might not be of technical interest, but today's web is absolutely atrocious to surf without a good set of ad blockers and privacy enhancement plugins, so that's a feature one day every browser is deemed to implement to attract users.
Too bad, there are no ACID4, 5, 6...
The web specs were broken for years since ACID3 managed to somehow stabilize them.