My progress at porting Ladybird, the SerenityOS Browser

Are you using a current Nightly version or the Beta?
Ladybird only works on Nightly because it uses some features that have been added recently.

I am on latest Nightly.updated dailyā€¦as of today

I just retried it with a freshly cloned repo and again freshly updated OS and canā€™t reproduce this,sorry.
It hasnā€™t finished building yet,my computer is old and slow,but itā€™s well past the 6/2621 step where it failed for you.
The file execinfo.h is part of the system and should be at /system/develop/headers/execinfo.h - Can you please check that this file exists on your system?

Please also note that you need to run git am haiku-support.patch where haiku-support.patch is the file I shared above,before you run the cmake commands,or cmake --build will fail early.
Anyway,even without applying the patch I donā€™t get the execinfo.h error but something else.

1 Like

Will that really happen? I remember talks about designing a new language for Serenity a few years ago, that would just be basically a simpler/nicer syntax over the c++ subset that they use (kind of like Vala for C with glib). But Iā€™m not sure anything happened eventually.

Is it the same idea in Ladybird now?

They did implement the language, called Jakt. At least the basics, I remember Andreas showing some examples on his Youtube channel. I think it got sidelined a bit when he started working on the browser that eventually became Ladybird.

I donĀ“t think they will use Jakt for Ladybird, they already got enough on their plates I guess.
They did get some questions recently (after splitting Ladybird from SerenityOS) why it wasnā€™t written in Rust. Given Andreasā€™ outspoken preference for C++ I doubt they will switch to Rust and rewrite everything again. But that`s pure speculation on my side, of course. Letā€™s wait and see what happens.

All that we know of about a rewrite is this:

1 Like

How so? Almost every mainstream OS is written in C or C++ so they would be in the same boat surely?

I seem to recall (from back when it was announced) that this Jakt language was expected to ā€œtranspileā€ into C++ code and thus would not require them to change their underlying language. Nim already does this, and would perhaps also be a candidate. It is discussed in relation to Haiku here and even used for writing an OS.

Sorry,I was totally wrong with the assumption that the file is part of the system.
Just tried building Ladybird on another machine and hit the same error.
Itā€™s part of the libexecinfo_devel package which is available at HaikuPorts.

Should I manually install this package from haikudepot?

Yes,install it and than the build should work.
Just retried it based on the latest commits,my last patchset still works with the latest source.

Ladybird is switching to Swift. What is the status of Swift on Haiku?

1 Like

Has Swift even been touched since 2017 on Haiku after the GSoC project porting it?

Oh,thatā€™s not exactly great news,but I didnā€™t expect something great either.
I hoped that theyā€™ll probably select Nim or something like that,with C++ binding support and already working on Haiku.
But I was quite sure that theyā€™ll choose something from the GAFAM,and Iā€™m a little bit happy that itā€™s at least not the Google crap (you shouldnā€™t have a major dependency on your biggest competitor,even if itā€™s open-source),but Swift being extremely focused on Apples own OSes probably wonā€™t make things easy for us.
I wonder why they canā€™t just stay with C++,everyone already involved in the project must know C++ rather well and they have a lot existing code in that language.
Maybe itā€™s not hyped enough or something like that.

As far as I am concerned with my port,I donā€™t really care.
Iā€™m already working with the sources from the Serenity repository,not the new Ladybird repository,and theyā€™re backporting some of the changes,so itā€™s still maintained.
Iā€™m still maintaining my patchset,and I will continue to do so,based on the changes from Serenity,not Ladybird.
I donā€™t expect big breaking changes here,so no need to worry.
It will most likely stay 100% C++ and free from external libraries.
I only hope that theyā€™ll be able to keep up with the changes from Ladybird and backport everything to their C++ codebaseā€¦

It has been disabled

Letā€™s be honest, C++ just isnā€™t that great of a language, and Swift is indeed a very good replacement for it. It keeps the good ideas from C++ (and Objective-C, the two are quite similar) and solve several of the performance issues and typical errors that C++ makes easy to happen, as well as making the code simpler to write.

Just creating a class in C++, it seems quite simple, right? But you have to remember to disable default copy constructors and assignment operators, since the default generated code most likely wonā€™t work. You have to add ā€œconstā€ everywhere possible because it is not the default (it would make so much more sense to add ā€œmutableā€ where needed). Using safe pointers (unique_ptr or shared_ptr) is a bit more code than naked pointers. You need to explicitly initialize some things (such as integers) in constructors, but not others (such as objects which have a default constructor). If you use a unique_ptr it will be initialized to nullptr, but if you use a naked pointer, it will have a random value. This is just annoying and tedious.

If I were to start a new project, Swift would definitely be one of the languages Iā€™d consider for it. By reading the documentation, you can see that the people who designed it have been getting hit by the same problems I encounter while working on Haiku and other C++ projects (while Rust was designed by mostly C developers, I think, which have a bit different set of problems to solve).

So, a reasonable and not very surprising choice.

12 Likes

3 posts were split to a new topic: Swift on and for Haiku

Thatā€™s very interesting. I had the impression that Rust was the more C++ like among the modern languages.

FWIW I understand from Wikipedia that Rust and Swift are contemporary of the mid 2010s; with Swift appearing in 2014 and Rust in 2015. As for whether one is more similar to C++ that is not something I am qualified to say.

I personally commend Ladybird in choosing to go against the current mindset in some quarters of ā€œthe answer is Rust, now what is the questionā€. Seeing how zealous people can get over such things I imagine that this must have set the cat amongst the pigeons for some of my fellow armchair followers of operating systems.

It might also be added that it is kind of ironic that Rust was developed by Mozilla specifically to write a browser and yet - despite its hype - is rejected for by Ladybird for this precise application.

After some break from the Ladybird porting project,I tried building the current Ladybird source from the SerenityOS repository today.
I rebased my patches on it and had to make some small additional patches for things that recently changed in the source.
You can download the current patchset here: https://upload.odirf.de/file/l090oA0FDd4z.patch
Not a lot changed when it comes to stability of Ladybird,it still frequently crashes with the same errors as before and I still donā€™t really understand the cause for that,so that I canā€™t fix it yet.

5 Likes