Ladybird Browser: State of the Union
By FUTO
Summary
Topics Covered
- A browser needs street smarts, not just book smarts
- We lie about our identity just to render pages
- AI agents collapsed a month of work into two days
- Lockstep verification makes Rust rewrites safe
- Browsers remain the path of least resistance
Full Transcript
Hello.
I'm Andreas Kling. I work on the Ladybird web browser.
And I'm here to talk about it with you today.
But before we start, I want to do a quick language lesson because this comes up a whole lot.
What's up, Peter?
Let's get the mic closer.
All right, sorry about that. Yeah, quick
language lesson. So,
this here is a ladybird.
This is a ladybird.
And this is Lady Bird Johnson.
Now, it seems silly, but this saves me like 10 conversations. So.
10 conversations. So.
All right.
Yeah, so this is Ladybird State of the Union. We're here at Futo in March 26. I
Union. We're here at Futo in March 26. I
was here a year ago doing sort of the full back story of Ladybird. So, I'm not going to go over
Ladybird. So, I'm not going to go over that again today, but it was a pretty good talk, I think. So, you can find it on the Futo YouTube channel.
And thank you, Futo, for having us, for sponsoring Ladybird. They are one of our
sponsoring Ladybird. They are one of our major sponsors, and we love working with them.
Okay, so today I want to talk about three things. I want to talk about
three things. I want to talk about Ladybird. I want to talk about our new
Ladybird. I want to talk about our new co-workers on the Ladybird team.
And I want to talk about adopting Rust for our project.
So, we'll start with Ladybird and what it is, if you didn't see that talk last year.
It is a new browser engine that we're building from scratch, and it's not a fork of Chrome or Safari or anything like that. Um,
like that. Um, so we want to do something entirely separate from from the Google empire.
Um, and last year I talked about how Google funds everything.
So, everybody hopefully already knows that, but now we're just going to go forward. So, Ladybird spun out of
forward. So, Ladybird spun out of Serenity OS. It was a hobby operating
Serenity OS. It was a hobby operating system that I started in 2018 for personal therapy purposes, and it became its own thing because people are really excited about building a new
browser.
Um, we've become a non-profit, so we are funded entirely by donations and sponsorships like uh the one we have from Futo.
[snorts] Uh we're not trying to monetize our product or our users.
And we are very simple folk. Like we
just want to build a browser.
That's why he is Swedish. Simple, not
trying to monetize, you know, it all tracks. Go on.
tracks. Go on.
[laughter] Indeed.
Uh no, we we just want to build a browser. We don't want to broker any
browser. We don't want to broker any search deals. We don't want to make uh
search deals. We don't want to make uh you look at ads. We don't want you to buy our crypto coin and we don't want to do any side quests like hardware or VPNs or whatever.
Um just a browser.
All right. So uh just taking a quick look at what's happened in the last year. Uh we've seen about 8,000 commits
year. Uh we've seen about 8,000 commits in our repository, so development very active.
Um we've gone from seven to eight paid engineers. Um so not really scaling like
engineers. Um so not really scaling like a typical startup, but uh we are growing the team a little bit.
Um but we also have new contributors who are like volunteer contributors to the open source project. Uh over 100 people, so that's cool.
And uh we've grown our code base by about 110,000 lines.
Um mixed feelings about that, but it's necessary.
And if we look at what Ladybird really is, it's just a lot of web standards that we've implemented here over the last couple years.
And we've spent um we've implemented more than these. These are the ones we've spent like a lot of effort on.
And they work pretty okay.
Um and the best way we have to quantify that is this thing called the web platform tests where we currently pass 91% of the tests.
Um it's doesn't really mean that we're 90% of the way to a great browser, but it's the industry standard test for browsers.
And in October we crossed 90% threshold, which Apple says very arbitrarily is that we're a big boy browser, so we can be an alternative browser on iOS one day.
Um so, but it again, it doesn't mean anything really. It's just the number we
anything really. It's just the number we have.
And then for JavaScript, there is a separate test suite called Test262.
Um we're doing pretty well on that one as well. I think we're second place
as well. I think we're second place right now. Firefox is slightly better
right now. Firefox is slightly better than us, but we are like doing well on on spec compliance and standards conformance and and these kind of things.
Um but all of that stuff is book smarts, right?
Um following the specs. Uh and for a browser to become useful, we need some street smarts as well.
Um because passing the tests and then surviving like the web pages that you all want to visit, very different things.
So, when we talk about street smarts, we're talking about accepting that the world is not perfect. I know, right?
Um and this means that maybe other browsers follow the standards 99% of the time, but 1% of the time they do something wacky, and that's what websites expect to
happen, because that's what browsers actually do.
And so, when a site breaks in Ladybird, we have to look at what the other browsers do, and then match that behavior more or less.
Um this is just the game that we have to play.
And um it means we have to test real websites, not just mess around with these um test suites, to find what's broken and then fix that.
And we also have to profile real websites to figure out what's slow, and then make that fast.
Um we have a lot of like JavaScript benchmarks and things like that, which are fun to work on and and they help guide optimizations a bit, but if the real web is slow, then the
user doesn't care that we have a six score on JetStream or whatever. So, um
this has sort of become our new focus in the last year.
So, let me tell you about the most annoying thing in the world.
Um web servers, they love looking at your user agent header uh and then serving you broken content on purpose if they don't know who you are.
Um this is super irritating.
Um so, this used to be our user agent. Um the
user agent is sort of how you identify yourself as a browser to to web services that you want to talk to.
Um so, we just did we just did it by the book, right? The book says the spec says
book, right? The book says the spec says you have to start with Mozilla even though it's not true, but then the rest is true. Like this is a Mac, I have an
is true. Like this is a Mac, I have an AR64 CPU, and I'm using Ladybird.
Um but that caused us so much subtle breakage that um we wasted so much time debugging for realizing it was just because of this,
the way we identify ourselves.
So, uh the way that we've had to solve this is just to uh lie and say that we are every browser.
[laughter] And it's so dumb, but it works.
[laughter] Um so, I'll show you.
I have some examples. So, here's
Instagram.
Um Oh, I know that guy.
Yes, that's Peter's Instagram.
[laughter] Uh this is what it looks like with our old user agent string. If we just say, "Hi, I'm Ladybird. Give me your content." Uh we get this version. And
content." Uh we get this version. And
then if we say we're every browser, we get like one with proper fonts and colors and stuff.
Um and there was no indication to us that anything was wrong in the first version. Like they didn't say, "Hey,
version. Like they didn't say, "Hey, you know, you're an old browser or unsupported or anything like that." They
just serve us different content.
Um here's Gmail um with the old version and here it is with the new version. And you get these like subtle differences. Different UI
elements show up suddenly and the design becomes more coherent.
And basically we only figured this out because we were messing around with um pretending to be Chrome, pretending to be Safari, and seeing how the web would
behave differently.
Um and one final example, this one perhaps the most irritating.
Sometimes this happens. You just get white nothing.
Uh and if you say that you're every browser, you get a webpage.
So this is Microsoft Azure and what's actually happening here is even more irritating uh because the website on the left will eventually
load um because they don't recognize us, they add a 30-second delay to every request.
And so eventually it will load after a couple of minutes, but that's like 30 seconds per file. So every image, every CSS stylesheet, whatever,
extend the load time by 30 seconds. Um
and yeah, but we we just figured this out by screwing around with the user agent string until we found something that was uh actually working.
And there's no like right way to do this.
There's no specification for how to do this, but this is street smarts, right?
We have to do this so that uh our users can browse the web.
Um yeah.
Now, I want to talk about our new coworkers that we have on the team.
Uh they are not human.
Um they are of course AI agents, which are all the rage, and I want to tell you how we use them um to develop Ladybird.
So we're finding that human-directed agents are uh what's useful for us at least, not autonomous. We see some projects that just uh let a bunch of agents loose and
and let them contribute to the project.
Uh the quality from that kind of setup doesn't seem great to me at the moment. So, we're
holding off on that.
But, we're finding these are extremely good uh sort of bicycles for the mind for our people.
So, we use AI agents to write code, to generate tests, uh to debug real websites.
Um and I thought I would tell you a little bit about some things I've been using them for personally in the last couple weeks. So, something
I have to do a lot is browser research.
And I have to figure out like how do the three major browsers handle this weird edge case?
Um so, going back to the street smarts, right? Like if there's something that
right? Like if there's something that we're doing according to spec, but website doesn't work right, we have to figure out well, okay, what are the other browsers doing then?
Um this used to be a very boring kind of painstaking process where I would have to sort of create a scenario in the standalone webpage and then try that in every browser and then try to reverse engineer they
were doing and how it was different. Uh but now um I can have an agent go and research all the three major browsers in parallel and then which is write a nice little
report for me that I have to read and it makes it super easy to decide then what Ladybird should do because we can just look at the little table of behaviors.
So, love this, do this all the time, saving me hours.
Um and another thing that I did recently in the last week with uh with AI agents was I built a new JavaScript interpreter.
So, I've been wanting to do that for years um and I knew exactly how to do it because when I worked on WebKit, we had an assembly language JavaScript interpreter
which was awesome and it's so fast, but it's also hard to do because you have to like create assembly for multiple CPU architectures and stuff.
And it just feel felt like this kind of project that, you know, it will take at least a month, probably more, to get it right.
Uh but with agents, took me two days.
And uh it works on both arm and x86, passes all of our tests, and has much better performance than our old interpreter.
So, we're hitting about 1.4x, 1.5x on JavaScript um performance tests.
Just from swapping out the interpreter in 2 days.
Pretty cool.
Um but of course, we've subjected this stuff to rigorous testing. We We're
operating um building a browser operates in an environment that is blessed with so much test.
Um so, it's makes it a lot easier to use AI.
Okay. So, the third section uh is adopting Rust.
We are trying to build a web browser for the future, and C++ probably isn't the best language for the future.
Um we love C++, and we're going to keep using it for a long time, but there are parts of our code base that we want to strengthen.
And um we knew we wanted a memory-safe language for that. And this is something we've sort of talked about doing a lot, but never actually made any progress until now. So,
until now. So, um the first question that always comes up though is like, why Rust?
And it's simple. Rust makes it harder for us to make programming mistakes when we're processing untrusted input. Uh we
download HTML, we download JavaScript, and CSS, and then we have to parse and execute that stuff.
Some of it is malicious. There are
sneaky people on the internet doing sneaky things.
Not all of them are as clever as the people uh Naomi talked about. Some of
them are just throwing you random but it's can still break.
Um and we have to deal with all that. And
just Rust just makes it easier to to deal with that.
And it also give us us the confidence to parallelize some of the heavy stuff in our engine.
Um you can parallelize C++ as well, but it's harder. And I know some people say
it's harder. And I know some people say skill issue, and yes, I have skill issues with C++. I'm not perfect. Um
and I think it's better to use tools that prevent bugs than it is to um I don't know, like cry about skill issues.
So [laughter] just my personal feeling.
Okay. So, um
using Rust or a second language used to be something that we talked about, oh, someday we're going to do this, right?
Someday we're going to have a memory safe language and then we'll be able to do all this parallelism and blah blah blah. Uh but in February it went from
blah. Uh but in February it went from someday to let's just do it this month.
And so, in February, uh I did a new JavaScript compiler, the whole thing, in Rust from scratch based on our old compiler.
And then once it was in Rust, I was confident to parallelize it. So, I made it multi-threaded so we can parse multiple scripts in parallel.
Um and then that JavaScript interpreter that I talked about it's written in Rust that then generates assembly for for the two CPUs. So, we're already making lots
two CPUs. So, we're already making lots of use of Rust and I want to zoom in on the first thing in particular because um a lot of people found it interesting,
so um we rewrote, or I rewrote, the Rust or the C++ compiler we had for JavaScript in 2 weeks and it turned out to be about
25,000 lines of code in Rust. Uh it passes all of our 65,000
in Rust. Uh it passes all of our 65,000 tests um with no regressions.
And it has byte-for-byte identical output with the C++ pipeline.
So, the way that I did that was I We this lockstep mode, sort of like an airplane computer.
Um where we run both the C++ version and the Rust version in lockstep, and then uh they we verify every step of the way that the outputs are identical. So,
that gave us a large degree of confidence that this thing is actually good and correct because it survives browsing the web and comparing that it behaves identically to what we had before.
So, that is pretty cool, I think. It
certainly changed my mind about what was possible with AI.
Anyway, at this point, you might be wondering what Ladybird actually feels like these days.
Well, you're looking at it.
So, we're in Ladybird.
Check it out.
Hey.
We can even browse the web. Now, this is terrifying.
Futo, don't be evil.
All right. We will go to the conference page.
Look at that. It's the program.
It's the talk you're watching. Check it
out.
We will open their x.com and their YouTube.
Just to kind of give you an idea. So, as you can see, we are just a real browser. This is not a toy.
Um and we can maybe even post something at Futo Tech. Hello from the podium. Oh,
damn it.
Boom.
Does it work? It worked.
Sick.
[applause] And here, why don't we go and click on a video here?
Uh we can also play we can play YouTube ads apparently.
Hey, ads work.
[laughter] Great.
Uh yeah, we can handle YouTube as well.
And um it work the sound works, but I have it muted.
Um and there are performance issues all over the place, uh but it's pretty sick that it works, honestly.
Um if you look here, you'll find that we only support 360p at the moment. It's
because we don't have the fancy media source API just yet. But we have folks working on that as well.
And I think uh this is going to be pretty sweet. So, let me just get back
pretty sweet. So, let me just get back here.
All right.
Oh my god, that was scary. Okay.
[laughter] So, the road ahead looks like this. Uh
this year we're going to do an alpha version um for Linux and macOS. And then after that, beta next year and production release for all platforms in 2028.
Um and it's not entirely clear what the criteria is for releasing the alpha. So,
we'll have to see when it feels right, but if we get to New Year's Eve we didn't put something out, we'll put it out on New Year's Eve no matter what because you should stick to schedules, man.
Um and then if we talk about what's left to do really for that 2028 production release, um there are five things really.
First thing is performance. As you saw, amazingly the browser is functional.
Uh but what it needs to get faster just everything needs to get faster and smoother and more responsive and whatever.
Um then there's security. Um we need to invest a lot more in this like isolating websites from each other, sandboxing, like preventing malicious behavior cross-sites, that kind of stuff. We know
what to do, but it's a lot of work.
And then we want extensions so that everybody can have ad block cuz I know everybody in this room probably wants ad block. I certainly do.
block. I certainly do.
Um and we don't want to be in the business of making ad blockers ourselves because we don't want to decide what you should see on the web and you shouldn't see on
the web. That should be up to you.
the web. That should be up to you.
Uh and then we have dev tools so that web developers can test Ladybird and figure out what's wrong um when they open their website. And
finally, the long long tail of every website in the world and the weird things that they do that we don't know about yet. So, we're going to want
about yet. So, we're going to want people to install this and go to your local bakery website and see if they have any new Madeleine
cookies or whatever. See if everything shows up and let us know if it doesn't.
And that's the end of my talk. Thank
you.
Thank you, sir. Thank you, sir. Uh
developer and a gentleman.
Um so, if anyone has questions, just line up there.
Um I do have a I have a question actually. Um it is kind of like a meta
actually. Um it is kind of like a meta question.
Hit me.
Um it's been 30 years basically since browsers were popularized.
Um I mean you have some experience in the world.
Like is it a little weird that we are so still so browser-centric? Uh you know, it's it's not like the 1990s anymore.
It's like is this where we're going to be for decades and decades? I don't
know.
It might be. It seems to me that browsers are the path of least least resistance for having a sort of a common computing platform.
If you set out to build an app today, you're probably not excited about building for Mac and Windows and Linux and iOS and Android and uh it's pretty sweet that you can just
build a web app. And so
the browser has sort of become that layer, I think, in the stack.
All right, Perry, you go.
Um So, you seem to be uh adopting I'm Perry Metzger, by the way. Speaker.
You go on.
Yeah. You seem to be adopting use of our robot friends pretty heavily along with everyone else who who seems to have touched it.
Have you considered using that to try to attack the long tail problem? Because
there you have something tireless that can bring up web pages in multiple browsers and try to figure out what the rendering problem might be in in in yours.
That I think that will be a huge part of that strategy for us.
Um and certainly also dealing with triaging of like incoming bug reports in our alpha and beta version.
Um which we anticipate will be a lot. So, we're hoping to be able to
a lot. So, we're hoping to be able to use AI agents to like handle incoming bug reports and verify and create test cases out of them and things like that.
So, we're I'm super pumped about that.
Very much.
And next.
What's your name again, sir?
Uh Remus.
Remus. Remus of lack of affiliation. Go
on.
Uh so, I have a question. Um I I've watched some of your prior content like speaking about the size of the Chromium code base. I think it's over like 10 million
base. I think it's over like 10 million lines of code. Um
what decisions was made that resulted in that big of a code base and um do you think like Rust like using Rust starting today like with an ideal
technology like how much more efficient of a code base can that like result to by making the right architectural decisions from the bottom up?
I don't know.
Um but as Z was saying, like browsers are 30 years old and the incumbents today they've been around for decades. And so, they've accumulated
for decades. And so, they've accumulated like just incredible layers of sediment and croft and and whatnot. And
what we're finding is that you don't need that much code to have a browser.
Um and I don't know if Rust will allow us to make it smaller, um, but we're just primarily hoping that it will allow us to make it better.
Um, but I don't think that we will ever need to reach this sort of level of scale that that Chromium has, for example, which is like over 30 million lines, I think.
Um, if we if we can stay below 1 million, I would be super happy.
Um, but we'll we'll see how that actually pans out. They have
pans out. They have a lot more features than we do still, so Number of lines of code is just a number. It's just a number, baby.
number. It's just a number, baby.
Indeed.
All right. Uh, Lee, do you have a question?
All right, Lee. Lee Lee, the protonian.
Is that Lee?
Hey. Um, so one of the things that comes to mind for me is that uh, in order for AI to interface with a lot of web websites and web pages, there's a
tool called Playwright.
Um, because you have to run it headless, otherwise you're like navigating a lot.
Um, have you thought about like putting some work into a tool like that where you could actually like gain kind of some side band adoption in the AI front, as well as using it for a
long tail tool?
So, we haven't been into that space at all yet. Uh, we've just been focusing on
all yet. Uh, we've just been focusing on making sort of a a desktop consumer browser.
Um, it's an area that I I find personally very interesting because it's unclear to me that um, sort of programmatic access to web content is the best solution or if you can just
give the AI eyes, let it look like a human would, and let it, you know, mouse around and click and stuff, maybe that ends up being the better solution. I don't know.
solution. I don't know.
Um, but I I'm sure there are a lot of startups that that hope it's not like that, but um, I think it would be pretty sweet if if the AI can just do what we do.
Um, but it's unclear. If if pan out that way, then yes, of course, we can definitely build tools that introspect the web content more readily and we have everything that we need to
be able to do that. It's just a matter of putting time into it.
We got we got another Fetonian. Jason
Rasmussen of Atlanta.
Hey, yeah, I'm on the image team. I just
I just talked to you. I apologize.
Yeah, that's all fine. My address is I [laughter] Oh no, I forgot my question.
Um Oh yes. Um I remember one time a long
Oh yes. Um I remember one time a long time ago, I feel like I wanted to like compile Chrome from source. I thought it would be cool, but it turns out it's basically impossible.
Like it's like takes way way too long and it's like insane, but building a browser in like the modern age, have you noticed that like is it a
lot easier to build Ladybird? Ladybird,
have you noticed like are contributors able to like run it locally themselves easier?
Has that influenced external contributors or like how is that kind of impacted the development process of Ladybird?
Okay, yeah, that's a great question and it's something that So I used to work on Safari at Apple and one of the things that people hated about contributing to Safari or Chrome or anything was indeed like you say it takes forever to build
and it's confusing and you need to do a thousand incantations to get it working.
So one of the big things that I love to have in Ladybird is that it's super easy to build. It's like one or two commands
to build. It's like one or two commands tops.
And we want to keep it that way so that the barrier to entry for new developers is very low.
Um but we still want you to do run one or two commands because otherwise if you just download Ladybird as a binary like a nightly build or something,
we find that people who do that they get mad and disappointed and then they leave unpleasant remarks for us.
But that like little step where you build it yourself by typing one or two commands makes all the difference and people are so much nicer after they go through that process.
All right. Oh, wait, one more. Woah,
woah. Yeah, let's let's go. You got you got one one and a half minutes. Go, go,
go.
I I'm My name is Sean. I work at a company called S E A N or S H A N?
S E A N.
Okay, go, go, go, go.
Uh, we work at a company here called Basepower.
Um Yeah, how has been your experience uh working in this new age of software development and dealing with agents like I know you worked very deeply on
SerenityOS and you know, it's a very deep technical like go in the rabbit hole problem and some of that's kind of like fading a little bit. Like I find myself kind of struggling a little bit.
Like I like getting sucked into really deep bug reports or problems like going real far into the stack. So, kind of like how have how's your mental shift around like this change in the landscape and working with these projects and
coding in general these days been?
Right. So, I think honestly, I'm freaking pumped about this new era of computer programming uh because I've always had more ambitions to build stuff
than I was able to do and um for me like one of the great steps in my life that happened was that people joined my open source project that I had as a hobby and like helped me to work on it and they
gave me like incredible leverage over what I could do by myself.
Um so, that that was like amazing, I thought.
And now this is happening again, but it's way, way um it's different and it's more and it's also less because you have to steer it yourself. So, it's
different, but it's super exciting cuz it's just an increase in leverage as I see it and I got big dreams for browsers and uh now I get to build them, so I'm pumped.
All right, give it up. Give it up.
Loading video analysis...