Browsers in D
Adam D Ruppe
destructionator at gmail.com
Wed Dec 20 13:55:27 UTC 2023
On Wednesday, 20 December 2023 at 06:29:30 UTC, Hors wrote:
> Rust is better choice than D if you have to run code from
> untrusted resources (html, javascript, webassembly...) it's
> safer, plus faster.
That's not how it actually works in any of the browsers though.
The code that implements those things is pretty universally C++,
and the sandbox is provided through operating system resources
instead of language features.
In the blog example program, you saw that there must be a
`Wv2App` (or `CefApp`) declared in main before doing anything
else. That object might appear to do nothing, but it actually
encapsulates a key part of the security sandboxing of the newer
browser: that's responsible for spawning the worker processes for
different jobs on different domains.
This is also why there's so much message passing in the
implementations - they can't see each other's memory directly!
More information about the Digitalmars-d-announce
mailing list