News for hackers. Stuff that matters.
Re:Servo’s new home by simias on Tuesday November 17, 2020 @11:41AM (#25125810)
What's the plan exactly? Will there be a Servo browser that integrates the servo rendering engine with some open source components (for instance from Firefox, WebKit or Chromium) that will let us use the engine stand-alone, or is it "just" going to be an engine for embedding in third-party programs?

The former seems like it would be a huge amount of work, but if it's the latter I fear for the long term survival of the project because it's going to be hard to build a community around such a project IMO.

Or is there a possibility that Firefox will try to integrate Servo even if it's developed outside of Mozilla? Seems unlikely to me.

Re:Servo’s new home by nvrspyx on Tuesday November 17, 2020 @12:37PM (#25126705)
A third-option that I would like to see is extending the latter to an Electron alternative (aka using Servo as a cross-platform GUI). There's definitely positives to Electron, but it would be nice to see a more performant, less memory hungry, and more battery friendly alternative.
Re:Servo’s new home by devwastaken on Tuesday November 17, 2020 @01:10PM (#25127280)
Servo last time I checked used the same if not more memory (100MB) for basic pages. There doesn't appear to be major differences for that application yet.
Re:Servo’s new home by jhoechtl on Tuesday November 17, 2020 @04:08PM (#25129861)
Why should there be any great difference? Firefox is already written in a language where compilers have been optimized since decades.

Rust will not bring that magic.

Re:Servo’s new home by trevyn on Wednesday November 18, 2020 @12:28AM (#25133526)
Rust makes it much easier to do complex performance optimizations safely, particularly those involving concurrency. The canonical example is the multi-threading of Servo’s CSS processor.

It’s not an automatic magic bullet, but in a world where humans are still writing the code, Rust’s feature set makes many performance optimizations much more practical.

Re:Servo’s new home by jhoechtl on Wednesday November 18, 2020 @07:37AM (#25136080)
When did Firefox last crash on you? Aren't we optimzing on a problem which is practically non-existing?
Re:Servo’s new home by ben-schaaf on Tuesday November 17, 2020 @06:40PM (#25131382)
Rust isn't what can bring that "magic", but a rewrite sure can.
Re:Servo’s new home by nine_k on Tuesday November 17, 2020 @06:43PM (#25131409)
Why, better lifetimes' control could reduce the RSS, and reduce the GC time / energy.

(Provided that the C++ version is not strictly optimal WRT resource allocation; I think it's a rather safe bet.)

Re:Servo’s new home by devwastaken on Thursday November 19, 2020 @10:44AM (#25150621)
Hypothetically there should be possibilities for significant memory reduction by being able to deploy only what you need from the runtime instead of having everything loaded at once.

The memory usage part isn't really apart of rust or C, but rather that projects like chromium require significant hoops to jump through if you wanted to compile electron with only what you need.

I expect that servo will be tackling this issue, the browser works standalone and that's a hefty achievement in itself.

Re:Servo’s new home by asveikau on Tuesday November 17, 2020 @11:38PM (#25133268)
I'm not personally a rust zealot, but I know that rust builds on LLVM and therefore benefits from some of that very same engineering effort that was built to optimize C and C++.
Re:Servo’s new home by Subsentient on Tuesday November 17, 2020 @11:53PM (#25133348)
Clang usually has worse performance than GCC.
Re:Servo’s new home by trevyn on Wednesday November 18, 2020 @12:24AM (#25133500)
Is there anything specific GCC does for performance that Clang/LLVM could adopt? How is this race expected to evolve over time?
Re:Servo’s new home by PeCaN on Wednesday November 18, 2020 @02:42AM (#25134127)
it's not so much that gcc does anything specific so much as LLVM is just really really inefficient—they don't track compilation time at all so it's easy for releases to regress, half the stuff in there is academics implementing their PhD thesis aiming for algorithmic accuracy with little regard for efficiency, and LLVM's design itself is somewhat inefficient (multiple IRs, lots and lots of pointers in IR representation, etc)

that said this makes it an excellent testbed but compilation time will keep getting slower every release until they start caring about it

Re:Servo’s new home by roblabla on Wednesday November 18, 2020 @05:08AM (#25135061)
The rust compiler team now tracks LLVM performance, see [0]. They are able to spot regressions as soon as they get merged, and petition to get the change reverted or performance fixed when the impact is large. This has been fairly successful so far, but obviously needs sustained efforts if we are to ever dream of ever getting halfway decent compilation times.

[0]: https://nikic.github.io/2020/05/10/Make-LLVM-fast-again.html

Re:Servo’s new home by pmarin on Wednesday November 18, 2020 @01:45AM (#25133854)
Not answering your question but in my experience reading assembly output of the two compilers the unoptimized output of Clang is atrocious while GCC is closer of what a human could have wrote. Clang seems to have to do better in optimization passes to archive similar results. Usually Clang was a faster compiler in O1 but I don’t think it’s true anymore.
Re:Servo’s new home by PeCaN on Wednesday November 18, 2020 @02:27AM (#25134066)
that's just because gcc has certain optimization passes that can't be disabled

(that said gcc -O0 is still absolutely nothing like what a human would write)

Re:Servo’s new home by chubot on Tuesday November 17, 2020 @01:25PM (#25127512)
Has anyone tried Cobalt? It looks like something based on it could be an alternative to Electron.

https://cobalt.foo/

It's meant for embedded but that probably just means it's easy to build and uses low memory.

A high-performance, small-footprint platform that implements a subset of HTML5/CSS/JS to run applications, including the YouTube TV app.

Re:Servo’s new home by spankalee on Tuesday November 17, 2020 @01:32PM (#25127627)
Cobalt lags on modern web APIs pretty badly. I wouldn't recommend it.
Re:Servo’s new home by chubot on Tuesday November 17, 2020 @02:53PM (#25128790)
Can you elaborate on that?

To be clear I wasn't suggesting that Cobalt is a replacement for Electron. Electronic has a lot of its own APIs too.

Rather, I wonder if Cobalt could be better than Servo along some dimensions as an engine for something like Electron.

[dead]
Re:Servo’s new home by spankalee on Tuesday November 17, 2020 @02:08PM (#25128173)
I have to make code work in Cobalt as part of my job. You?
Re:Servo’s new home by kortilla on Tuesday November 17, 2020 @02:19PM (#25128340)
Parent was tone deaf but the point is that if you want a bunch of cutting edge APIs then Cobalt isn’t really for you. It’s light weight.
[dead]
Re:Servo’s new home by dang on Tuesday November 17, 2020 @03:10PM (#25129057)
Hey, please don't be a jerk in HN comments. If you know more than others, that's great, but the thing to do is to share some of what you know so the rest of us can learn something. If you don't want to do that, not posting anything is always an option. But please don't post unsubstantive comments and especially not nasty unsubstantive comments.

https://news.ycombinator.com/newsguidelines.html

Re:Servo’s new home by andrewmcwatters on Tuesday November 17, 2020 @03:19PM (#25129212)
I welcome you to go read the rest of my posts in this thread and get back to me on whether or not my posts are substantive, thanks!
Re:Servo’s new home by dang on Tuesday November 17, 2020 @05:46PM (#25130956)
I didn't mean that all of your posts were that way, only some of them.

Can I try my luck at persuading you a little? The reason we moderate like this is not because of morality or taste. It's because of the dynamics of a community of HN's size. The goal is simply to have a community that doesn't suck. That is in all our interests, including yours, as you're participating here.

There are other internet communities, smaller and more cohesive ones, and usually with a specific technical focus, that have a culture of shaming people for being wrong or knowing less. Arguably this can help to keep signal/noise ratio high by punishing low-quality, low-effort posts, demanding that people do their homework first, and so on. Some of these communities have functioned pretty well for many years.

But it's not an option for HN—this community is too large and incohesive. If we were to allow it, such tactics would soon spread, not in service of technical accuracy, signal/noise ratio, or anything like that, but just general douchery. Ignorant users would see knowledgeable users treating others that way and would follow the worst part of their example—not the becoming-knowledgeable part (that would require an effort!) — just the being-a-jerk part.

Then we'd see an exodus of users who don't want to be surrounded by that kind of thing. Then general douchery would comprise a higher percentage of what remained, making the next exodus even bigger. For a community like HN, this is how you get catastrophic decline.

In order to keep HN worth participating in, we have to have a culture that is on the good side of these nonlinear effects—i.e. we need interactions that raise overall quality rather than damaging it. Situations when a user posts something wrong or ignorant are a classic example. Correcting misinformation is good, but some ways of doing it harm the ecosystem while others benefit it. You have to consider not only the local (comment-to-comment) interaction but the systemic effect of such interactions as they compound.

That's why, in situations like this, we ask people who know more to share some of what they know, so others can learn. That way you're not just executing a local destroy operation on some mistake, you're helping to raise the level of knowledge of the community and the quality of the thread. These actions have systemically beneficial effects instead of toxic ones. If you (i.e. we all) do that repeatedly, you end up with a community that you actually want to be part of.

Re:Servo’s new home by Frondo on Wednesday November 18, 2020 @07:53AM (#25136178)
Holy shit, Dan! I just gained so much respect for you as a moderator (and therefore participant) in this community.

Taking the time to write out this very thoughtful, insightful reply to someone who may be knowledgeable but was throwing out hostile one-liners, that is impressive and gives such a great deal of credibility to the work you're doing here -- work that largely goes unseen, of course.

Amazing.

(I actually put down the piece of food I was eating, mid-bite, to write this out. You made my day!)

Re:Servo’s new home by chubot on Wednesday November 18, 2020 @03:16PM (#25141861)
Yeah honestly someone should try to make an AI clone of dang :) I think that would go along way toward solving the problems of the Internet...

I'm sorta joking but also serious because there is a big corpus to train from :)

Re:Servo’s new home by dang on Thursday November 19, 2020 @01:30PM (#25152650)
Re:Servo’s new home by Razengan on Tuesday November 17, 2020 @11:49PM (#25133321)
I wonder if they could also adapt into a game UI framework; design fast, cross platform, scalable game HUDs with HTML/JS.
Re:Servo’s new home by NetOpWibby on Wednesday November 18, 2020 @01:32AM (#25133796)
I’ve posed this question several times online and in the Servo repo and the response was always, “Umm, no, not interested.”
Re:Servo’s new home by pjmlp on Wednesday November 18, 2020 @09:41AM (#25137243)
The alternative exists since 20 years now, run a background daemon with local browser, or ping back in the platform WebWidgets.
Re:Servo’s new home by sergiomattei on Tuesday November 17, 2020 @11:54AM (#25126014)
This is also my concern. Everyone's cheering on, but I'm just thinking... What's the mission and end goal now?

Previously it was doing research, with the possibility of landing in Firefox. Now that's highly unlikely.

Re:Servo’s new home by danShumway on Tuesday November 17, 2020 @12:30PM (#25126590)
> Servo’s high-level goals remain unchanged: to provide a high-performance, safe rendering engine for embedding in other applications.

This is exactly what I want their goals to be. Embedding Chromium in applications is cumbersome, bloat applications, etc...

In the long run, having more options of web renders to use will help with everything, including browsers. Maybe it won't all be pulled into Firefox, but (ignoring all the other problems with DRM/regulation/anticompetive behavior/etc) it'll at least make it a little easier for other people to build browsers, and it opens the door for us to have more lightweight alternatives to applications like Electron.

Re:Servo’s new home by kodablah on Tuesday November 17, 2020 @02:29PM (#25128471)
This is a big one for me. I have to use CEF because it's the only easily embeddable engine for me.
Re:Servo’s new home by jfk13 on Tuesday November 17, 2020 @11:57AM (#25126054)
Is it really so unlikely? Firefox integrates all kinds of components from elsewhere; why shouldn't it continue adopting parts of Servo where appropriate?
Re:Servo’s new home by cogman10 on Tuesday November 17, 2020 @12:10PM (#25126259)
Seems just more unlikely.

It's one thing for a mozilla team member to say "Hey, let's pull the servo css layout engine into firefox" It's a whole different thing for someone to say "Hey, let's pull the webkit css layout engine into firefox".

The servo stuff, while for experimentation, was ultimately geared towards the notion of landing parts of it into firefox. It was built for that. Under an opensource foundation maintainer model, there's a strong possibility that it moves from that as a goal.

Re:Servo’s new home by yjftsjthsd-h on Tuesday November 17, 2020 @01:22PM (#25127470)
I would still expect servo to at loosely remain "firefox shaped", at least far more than the separately-developed webkit lineage.
Re:Servo’s new home by smnthermes on Tuesday November 17, 2020 @02:06PM (#25128150)
The true difference is that Servo is more modular than WebKit.
Re:Servo’s new home by eznzt on Tuesday November 17, 2020 @01:34PM (#25127655)
So the Servo developers will now work for free but Mozilla will start to leech from it? That would be uncool.
Re:Servo’s new home by DominoTree on Tuesday November 17, 2020 @01:40PM (#25127752)
It's an open-source project - a lot of us have already been working for free :)
Re:Servo’s new home by edgyquant on Tuesday November 17, 2020 @09:34PM (#25132551)
Would be preferable imo, helps keep the name in the news and is a reason for the product to exist and expand. If FF uses it and it gets embedded into web apps outside of that it will a big boon to the project and rust community.
Re:Servo’s new home by throwaway894345 on Tuesday November 17, 2020 @11:57AM (#25126052)
With respect to the latter, I agree that it seems unlikely that the project would attract users. Maybe it’s my own ignorance, but I don’t know what kind of apps (besides web browsers) would want just the web rendering engine and not various other components in a web browser. What are the responsibilities of a “web rendering engine” anyway? How tightly coupled is it to the DOM? Does it “own” the DOM, or is that owned by some other component in the browser? In the latter case, how are the relevant aspects of the DOM communicated to servo? And does the rest of the web engine query servo for things (e.g., “what are the exact coordinates of this <div>?”)? If this engine ends up not being so web-specific, then maybe it could be used as a replacement for Skia, more or less.
Re:Servo’s new home by akiselev on Tuesday November 17, 2020 @12:05PM (#25126170)
You send Servo raw display lists, which is a format tailored specifically to represent the DOM but it acts like a generic slicing compositor in practice. It's not coupled in the classical sense - the display lists represent shapes, colors, stacks, rounded borders, etc..

It's more like Skia and can be used to develop GUI frameworks (which is exciting because Servo is Rust and Rust's GUI story is still in its early stages).

Re:Servo’s new home by tannhaeuser on Tuesday November 17, 2020 @12:20PM (#25126435)
Thanks for that explanation. From the website, it wasn't quite clear to me (and still isn't tbh) whether servo is merely a rendering or also a CSS layout (+ parsing etc) engine.
Re:Servo’s new home by mst on Tuesday November 17, 2020 @01:48PM (#25127881)
The Servo CSS engine is what powers Stylo to handle CSS in Firefox Quantum.
Re:Servo’s new home by szundi on Tuesday November 17, 2020 @01:51PM (#25127932)
Very true, just wanted to find out what it is and not easy.
Re:Servo’s new home by throwaway894345 on Tuesday November 17, 2020 @12:40PM (#25126755)
Thanks for clarifying. This is exciting indeed! Are you aware of usage outside of browsers?
Re:Servo’s new home by LockAndLol on Tuesday November 17, 2020 @12:34PM (#25126656)
The latter would be better, imo.

Chromium won because it introduced a sane API before Mozilla's Gecko. That's why you see so many Electron apps. Seriously, we don't need to wrap a whole browser. Just the engine and a debugger would've been fine.

The engine could be distributed as a lib and other frameworks could just bind it. Apps could be distributed without an 150MB behemoth just to have a chat client.

Making the engine also mobile compatible would mean Android and iOS could maybe have the same base. I also look forward to what this means for Linux phones. Custom browsers could be written for those that don't have to use WebKit or try to launch Chromium or Firefox on a mobile device.

Not only for mobile devices, but also displaying things in VR can be made significantly easier if you don't have to write all the UI yourself. Give it an opengl rectangular surface (or vulkan?) and you can then use web technologies to make UIs in VR.

All in all, I'm very for an engine. It would definitely allow a competitor with a good name to enter the market. Developer should be able to reach for something else than WebKit because nobody in their right mind is going to reach for Gecko.

Re:Servo’s new home by smnthermes on Tuesday November 17, 2020 @02:10PM (#25128205)
> That's why you see so many Electron apps. Seriously, we don't need to wrap a whole browser

Actually, Electron wraps an entire browser, except for its UI part.

Re:Servo’s new home by tsimionescu on Wednesday November 18, 2020 @02:46AM (#25134155)
I'm not sure what you mean by 'an engine', but people who choose Electron typically don't want a rendering engine like Servo, they want to write a web app and have it installed locally. They need a rendering engine, a JS runtime, a DOM handler, an HTTP client library, WebSockets support etc - they want a whole browser.

Also, 150MB is not really that scary of a size in today's world. Also, a huge part of it is simply because of static linking - if they split it into dynamic libraries, the actual content of any individual Electron-based app would be reduced significantly. But people are mostly allergic to dynamic libraries, so we pay the cost in larger binaries. Also note that vim with all its dependencies is ~40 MB, without a GUI.

Re:Servo’s new home by Deukhoofd on Wednesday November 18, 2020 @03:19AM (#25134313)
> Also note that vim with all its dependencies is ~40 MB, without a GUI

That's mostly just due to vim-runtime though, and the documentation in many different languages. The actual vim executable is around 3 MB.

Re:Servo’s new home by tsimionescu on Wednesday November 18, 2020 @01:44PM (#25140648)
Can the vim executable run without vim-runtime, or the other shared libaries it installz? I don't know the internal architecture of vim, I am genuinely asking.
Re:Servo’s new home by int_19h on Wednesday November 18, 2020 @06:18PM (#25143967)
> Also, 150MB is not really that scary of a size in today's world

That very much depends on where you live.

Re:Servo’s new home by Jweb_Guru on Wednesday November 18, 2020 @10:25AM (#25137763)
To be honest, a lot of people really do just want a layout engine.
Re:Servo’s new home by an_opabinia on Tuesday November 17, 2020 @12:04PM (#25126161)
It’s tough. People really do want Flash, it’s just Google Chrome now.

The bigger question is when will Mobile Safari retire its WebKit fork? What role will Servo play in that inevitable end point?

Re:Servo’s new home by bsimpson on Tuesday November 17, 2020 @12:25PM (#25126515)
Apple founded WebKit, so I doubt it will retire its repository.

Are you asking for iOS and macOS Safari to converge, or for Apple to ship straight from the open-source HEAD?

Re:Servo’s new home by satya71 on Tuesday November 17, 2020 @01:35PM (#25127675)
Apple forked WebKit from KDE KHTML.
Re:Servo’s new home by bsimpson on Tuesday November 17, 2020 @02:54PM (#25128796)
They aren't mutually exclusive.

WebKit was originally based on KHTML, but Apple still founded WebKit and controls its source code. Even if WebKit was just Apple's name for their internal fork of KHTML, I don't see any reason they'd retire it.

Blink was originally spun-out of WebKit too. Similarly, Google controls Blink, and the two have diverged significantly in the intervening years. I suspect patches for any of them won't apply cleanly to the other two.

Regardless of their origins; KHTML, WebKit, and Blink are now independent pieces of software.

It's still unclear to me why anyone should expect Apple to retire WebKit for iOS.

Re:Servo’s new home by cies on Wednesday November 18, 2020 @02:57AM (#25134198)
> Apple still founded WebKit

> Blink was originally spun-out of WebKit too

Founded, spun out of, forked... What's in the name?

I think one cannot "found" something that's largely based on a fork of something else.

Re:Servo’s new home by bsimpson on Wednesday November 18, 2020 @01:13PM (#25140189)
There's more to a project than code. A project can absolutely be founded, even if the code is entirely based on another project.