atlas-engineer / nyxt

Nyxt - the hacker's browser.
https://nyxt-browser.com/
9.71k stars 405 forks source link

Support Chrome-based renderer #2989

Open aadcg opened 1 year ago

aadcg commented 1 year ago

WebKitGTK has enabled us to mature Nyxt, but it is undeniable that its performance as a web renderer is subpar when compared to Chrome-based ones. This is particularly noticeable in resource intensive tasks such as watching a video on YouTube.

Supporting new renderers is in itself beneficial since it puts Nyxt's API under the test. As a remainder, Nyxt is renderer agnostic.

To achieve this goal there are two alternatives: CEF or Electron. The former has proved to be tough to achieve, while the latter seems promising.

WebKitGTK will continue to be supported.

This move will also helps us to distribute Nyxt on MacOS and Windows.

aartaka commented 1 year ago

There's always QtWebEngine as yet another Chromium wrapper that's more or less ethical and modularized. Just that it's C++ and pain to bind to (⌒_⌒;)

LinArcX commented 1 year ago

Really? Electron?

Did you measure performance?

aadcg commented 1 year ago

@LinArcX performance is certainly an important factor. But the ability to easily write Lisp bindings is actually the most important aspect to achieve this goal.

Others can expand on the technical issues, if you'd like to :)

aartaka commented 1 year ago

Yep, ease of Lisp bindings is the main feature for us, because we don't have:

fnicastri commented 1 year ago

I really like the idea of Nyxt and I would like to be capable to use it on Mac but, honestly, Electron would be probably a bad choice.

aadcg commented 1 year ago

@fnicastri Would you like to expand? Thanks.

Haider-Mirza commented 1 year ago

The Vieb browser also uses electron, it uses it well and I find electron to be a promising option especially if it provides easy Lisp bindings.

The faster speeds would be nice :)

aadcg commented 1 year ago

@Haider-Mirza that remark is spot on!

LinArcX commented 1 year ago

I don't understand the word of "promising".

Guys, you are not creating a toy tool. This is a browser.

We're living in a world that most people's work migrated to the web. So look at nyxt as an operating system.

Performance matters and it matters a lot in your domian.

Please don't waste your time and efforts with "promising" technologies.

ILoveGoulash commented 1 year ago

Are there numbers about the performance gap relevant to real world use? What about complexity (incl. bloat) or features (e.g. the recently talked about JPEG XL thing)? Is supporting more than one implementation going to be a massive pain in the "glue" part of the code? Webkit seems to be more suited to CL in spirit: much more conservative than Blink (same for jscore vs v8).

Not that, as a beggar, my opinion matters much, but personally, I'd focus on reaching a good "feature complete" state (whatever that means; for most, it's having a proper (not hostfile based) adblocker) before thinking about such a big endeavour.

Also, even if Electron is only the rendering part of Chromium, I'd try to make sure that all the Google spyware that ungoogled-chromium or qtwebengine had to remove stays gone.

aartaka commented 1 year ago

Guys, you are not creating a toy tool. This is a browser. We're living in a world that most people's work migrated to the web. So look at nyxt as an operating system.

We already do. And, much like an operating system doesn't care about the graphic chip or OpenGL version that's installed on one's machine (I'm somewhat exaggerating, but still), we don't really care about what renderer is there, as long as it works and allows us to build this exact Nyxt system.

Performance matters and it matters a lot in your domian.

That's exactly why we look into Electron: it's basically Chromium torn apart to be embeddable anywhere. And, however painful it is to acknowledge that for me:

The notoriety of Electron is the consequence of it being used in a really wrong way: as GUI for desktop application. It's slow, it's resource-heavy, it's not really configurable and accessible... for a desktop GUI. It's intended to be a browser engine, not a GUI. And that's why we picked it as the renderer for Nyxt: it's a browser engine. Intended to be a basis for a browser, just gone astray into the land of desktop and wreaking havoc there.


As it's been already stated above, the main thing we look for in the new engine is ease of bindings and maintenance. So, if someone is religiously opposed to Electron (as a browser engine, not as a desktop GUI framework—because the latter I'm opposed to too) to a degree sufficient to spend their time helping us find alternatives and work on them—we'll be glad to accept any contribution. Two directions that we abandoned because of the terrible time we spent binding them were:

So if someone has enough experience with these (or any other technology we're unaware of) to help us bind those to Nyxt, then I myself (and, likely, other team members too) will happily ditch Electron and help this person in making a better port for Nyxt.

But, until that happens, Electron is our best bet, given the resource/expertise restrictions we have on the team.

aadcg commented 1 year ago

The notoriety of Electron is the consequence of it being used in a really wrong way

Precisely!

fnicastri commented 1 year ago

Thanks for the explanation, it makes more sense now. Still hope one day another way will open... Maybe another, lighter, electron-like one that use the already installed engine? Or Servo...?

Anyway can't wait to use it on Mac ;)

Gavinok commented 1 year ago

Have a look at servo on its own and you will see it's no where near ready. It's currently as slow as molasses and even less stable than WebKit.

I worked on porting it to Nyxt and it wasn't long before I realised it's a lost cause

fnicastri commented 1 year ago

What I meant was: maybe in the future Servo will be an option, I know it's not stable nor workable for now.

moumn-almunawy commented 1 year ago

Why not use tauri?

aadcg commented 1 year ago

From my cursory look, tauri uses WebKitGTK for GNU/Linux. Nyxt already uses it today directly, without a middle man. Thanks for the tip, but I don't see how it could help us in supporting a new web renderer.

AlexanderMaxRanabel commented 3 weeks ago

Its kind of a bummer that we cannot have browsers without Chromium these days

ed9w2in6 commented 3 weeks ago

@AlexanderMaxRanabel It seems that Chromium is more secure though: https://madaidans-insecurities.github.io/firefox-chromium.html

And personally I found that Chromium looks better on across different OSs when compared to Firefox.

That being said I'm using a mac and the webkit-based Safari mostly.