

Servo: Embeddable Browser Engine - Manishearth
http://blogs.s-osg.org/servo-the-embeddable-browser-engine/

======
agumonkey
cache:

[http://web.archive.org/web/20150513190529/http://blogs.s-osg...](http://web.archive.org/web/20150513190529/http://blogs.s-osg.org/servo-
the-embeddable-browser-engine/)

------
kodablah
Is Servo going to employ a multi-process model like Chromium? I am afraid so
which makes it very tough for embedding. I see cef_execute_process [1] and
what not are not implemented. Are there plans to implement that far up the
embedding API? Hopefully a single-process-yet-multiple-page/tab embedded servo
is fully supported (unlike --single-process for CEF/Chromium).

1 -
[https://github.com/servo/servo/blob/master/ports/cef/core.rs...](https://github.com/servo/servo/blob/master/ports/cef/core.rs#L100)

~~~
pcwalton
Yes, Servo is going to go multi-process. There's a PR to do that already
(though it needs a good amount of forward porting at this point).

It's hard to say about single-process mode; it'll stay maintained as long as
someone's willing to do the maintenance. There isn't anything that's
inherently multiprocess about the architecture (for example, there are
basically no global variables anywhere in Servo), in any case, so I don't
imagine it'll be hard to keep it running. I don't want to make any promises,
though.

~~~
infogulch
What are the benefits of multi-process over merely multi-threaded for a
guaranteed memory- and thread-safe language like rust?

In the Chromium Multi-process Architecture design document[0] the benefits
boil down to security and stability. While memory safety doesn't guarantee
secure logic, it obviates a large class of bugs that a multi-process
architecture is designed to counteract. While memory safety doesn't prevent
deadlocks, it does completely prevent data race conditions.

[0]: [https://www.chromium.org/developers/design-
documents/multi-p...](https://www.chromium.org/developers/design-
documents/multi-process-architecture)

~~~
brson
You are right that process sandboxing is not as important for Servo, but it is
important: 1) more defenses are more better, 2) Servo contains considerable
amounts of C and C++ code and will for some time, 3) Even safe Rust has
failure modes that can abort the process (primarily out-of-stack), and
multiprocess provides recovery for when they happen.

~~~
TD-Linux
Not only that, but the Javascript JIT emitted code is unsafe. There is no way
to guarantee its safety, even with a JIT implemented in Rust.

------
frik
I can't wait til I can use Servo with a basic HTML based UI on Win7 - like
Phoenix 0.1 for WinXP, picture:
[http://upload.wikimedia.org/wikipedia/commons/7/7d/Phoenix_0...](http://upload.wikimedia.org/wikipedia/commons/7/7d/Phoenix_0.1.png)
History:
[http://en.wikipedia.org/wiki/History_of_Firefox#Naming](http://en.wikipedia.org/wiki/History_of_Firefox#Naming)

~~~
Manishearth
We have servo-shell as an HTML UI[0], which is pretty nice.

Windows support is still a while away. You can help out[1], though!

[0]: [https://github.com/glennw/servo-shell](https://github.com/glennw/servo-
shell)

[1]:
[https://github.com/servo/servo/issues/1908](https://github.com/servo/servo/issues/1908)

------
some1else
Tangential question: Is it possible to parallelize constraint-based layouts?

Update: There is paper[1] describing layout parallelization with 80x
performance increases. However, I'm not sure it works on constraint-based
layouts, such as GSS[2].

[1]
[https://lmeyerov.github.io/projects/pbrowser/pubfiles/paper....](https://lmeyerov.github.io/projects/pbrowser/pubfiles/paper.pdf)

[2]
[http://gridstylesheets.org/guides/ccss/](http://gridstylesheets.org/guides/ccss/)

~~~
Manishearth
From [http://kmcallister.github.io/papers/2015-servo-experience-
re...](http://kmcallister.github.io/papers/2015-servo-experience-report-
draft1.pdf)

> Ras Bodik’s group at the University of California Berkeley worked on a
> parallel browsing project (funded in part by Mozilla Research) that focused
> on improving the parallelism of layout. Instead of our approach to parallel
> layout, which focuses on multiple parallel tree traversals, they modeled a
> subset of CSS using attribute grammars. They showed significant speedups
> with their system over a reimplementation of Safari’s algorithms, but we
> have not used this approach due to questions of whether it is possible to
> use attribute grammars to both accurately model the web as it is implemented
> today and to support new features as they are added. Servo uses a very
> similar CSS selector matching algorithm to theirs.

------
Animats
Another step forward towards the post C/C++ world.

------
shmerl
So, may be KDE should use embedded Servo instead of Qt WebKit? Or even better,
make that engine pluggable to allow choice?

~~~
repsilat
It would certainly make for some curious history. I guess this was tongue in
cheek?

EDIT: for those wanting context, WebKit started its life as fork of the KDE
project's KHTML, and has gone on to supplant it. Having KDE ditch WebKit for
Servo (no doubt with Safari and Chromium still using WebKit-based renderers)
would be an strange state of affairs.

~~~
shmerl
Even if "strange" it would be a good state of affairs, since Servo is
definitely going to have better performance (and I expect security). Plus it
might help Debian to avoid some concerns they had recently regarding KDE
packaging.

~~~
duaneb
> Servo is definitely going to have better performance (and I expect
> security).

Is this clear? The multi-core rendering surely can't be used for every page.

~~~
CrystalGamma
Unless you have CSS floats affecting the whole page, 90% of DOM elements in
one parent element or other pathological cases my impression was that it is.

~~~
pcwalton
Small nit: The fact that most elements on the page are immediate children of
one parent doesn't necessarily negatively affect parallelism. It only will if
all those children are "display: inline". (For example, if your entire page is
one giant paragraph hundreds of thousands of words long, then you won't get
much parallelism out of layout. But you will if you have hundreds of thousands
of separate paragraph elements, even if they're all siblings of one another.)

------
haberman
Is it possible with this API to run headless?

I always lamented that you can't make a command-line, programmable tool that
is a fully robust implementation of the web. It would be very cool if this
could enable it.

~~~
pcwalton
You could probably rig up a headless implementation, as CEF doesn't create its
own windows if you run it in offscreen mode (as any widget embedder would do).
Servo does have a "true" headless mode (headless.rs) as well that we use for
running tests, though it's not exposed through CEF at the moment.

------
ksec
Would License be an issue? I see GPL / LGPL, MIT / BSD or Apache as being
mainstream.

Why MPL again.

~~~
justinjlynn
I'm sure that it's because Mozilla is comfortable with it. In reality, they
don't owe us anything in particular. They chose a licence that works for them,
is OSI Open Source(tm) approved and is compatible with a number of other
licences (Apache, GPL, et al). Good enough.

------
AlisdairO
Cached:
[http://webcache.googleusercontent.com/search?q=cache:2ziypEd...](http://webcache.googleusercontent.com/search?q=cache:2ziypEdabXcJ:blogs.s-osg.org/servo-
continues-pushing-forward/+&cd=2&hl=en&ct=clnk&gl=uk)

~~~
itistoday2
Different post. agumonkey posted the right one.

------
tinganho
I hope that they can switch out Atom with this.

------
ausjke
so how is Servo different from Chromium Embedded Framework and what value it
brings?

~~~
grayrest
CEF is the API used to embed Webkit (now Blink). Servo is Mozilla's new
research rendering engine, it's adopting the CEF API to make embedding easier
for people.

------
pc2g4d
Error establishing a database connection

------
nashashmi
If anybody is having connection issue:
[https://www.readability.com/articles/16xpxxli](https://www.readability.com/articles/16xpxxli)

~~~
chadzawistowski
Hmm, this looks to be a different article.

~~~
cmrx64
Yeah, completely different, and much older.

------
alphonse23
That little wordpress blog can't handle headline HN's traffic. Apache just
doesn't cut it anymore these days.

~~~
ericb
Properly configured, Apache scales just fine. This site looks like it is
running out of database connections. That's not something you can blame Apache
for.

