Swift (and other programming languages)

First a bit of context. As a follower / user of Haiku I became aware of Serenity - another hobbyist operating system - with its own browser called Ladybird. There have already been efforts to port this browser to Haiku. It was then announced that this browser will be forked from the main operating system which was seen as promising because the author of Serenity (Andreas Kling) specialised in browser design. Although Haiku already has its WebPositive browser, it languishes behind other web browsers. As with the rest of Serenity, Ladybird was written in C++ just like Haiku (and indeed Genode). So far so good.

However it was inevitable that many would ask whether C++ was an appropriate choice to write a new browser given the fad for “safe” languages. Whereas it might seem that language choice nowadays could be summed up as “the answer is Rust, now what was the question”, Ladybird decided to road test a few languages and - in a surprise development - announced that Swift worked best for them and they would adopt that in future.

This has led to a long and stimulating thread on Haiku forum about bringing Swift to Haiku. As far as Genode / Sculpt is concerned the benefits of being able to build Ladybird would seem to justify porting Swift, and these benefits would accrue with any further projects that use that language.

With the above in mind, has there been previous interest in bringing over Swift to Genode? Has much consideration been given to the benefits and the challenges in doing so? Would it provide a more accessible language for novices - like myself - than native C++ or the already established Rust?

I’ll be following responses to this topic with interest, as a possible user of Ladybird, and (even more so) in my quest for information on potential “C++ successors”.

Not much information I can provide myself, on the port potential and on the interest for laydbird. Looking at their FAQ I see they expect to have a first usable beta only in 2026, and not sure how big their team is, how experienced they are, and what “notch” they are aiming at: are they aiming at being as good as Falkon ? Or do they aim higher and want to actually go top notch and be better than even FireFox ?
To be honest, I can understand people shaking their head at the whole “web rat race” crazyness, with browsers becoming more complex than OSes, and people suggesting ‘we’ change course.
Sometimes I wish I had time to look into the Gopher and Gemini worlds, as alternatives to the http/html world ^^. But that’s to be expected since I’m also the type to look at NNTP as an alternative to modern forums, lol.

Re Swift, in my few years as a Genodian I don’t recall seeing Swift mentionned as a port candidate. Would need to take another look at it too, it’s been years since I did, I vaguely remember checking it out and dismissing it as “too bloated for what it brings to the table” or some such, don’t remember for sure.

If you’re trying to get your feet wet with programming, and feel shy asking for help doing C++ ^^, then I would give a fairly high recommendation to V (vlang.io)
After a one year hiatus, I’m myself going to get back into it. for a potential contract job. Will probably start this coming week on Debian. Some day it might even get ported to Genode and SculptOS (by the look of it, I’ll be the one doing the port, the compiler/interpreter is so simple and compact that I might even pull it off semi-easily).

It might not be a replacement for C++ at scale (I’m still dubious at their choice re. ctors and dtors, among other things), despite their targetting the language as fit for writing an Operating System (Vinix) and a web browser, but it sure beats the cr@p out of C++ when it comes to deployment, ease of use, intelligible compiler warnings and errors, and a whole host of other things ^^ Too many to list here, just take a look at their landing page.

Let’s hear it for more suggestions and questions!

1 Like

The Ladybird browser is certainly a long term project and it is not inconceivable that by the time it comes about we will all be using Servo driven browsers anyway. I agree with your sentiment that writing a programme to look at kitten pictures on other computers should not be a multi year project and that in an ideal world we would use a much simpler protocol like Gemini.

Thank you for the recommendation of V. My initial thought is that it might be the language that 9Front (fork of Plan 9) are looking for. Go was written by former employees of Bell labs, is seen by much of the Plan 9 community as building upon that tradition, and V positions itself as a better Go. It also compiles to C (used by Plan 9) rather than C++ (used by, say, Genode and Haiku). But I digress.

Rust by comparison strikes me as an overcomplicated language for an overcomplicated paradigm of computing. Its deployment seems to be driven by the diktats of big capital, just look at the corporate sponsors of Rust, a who’s who of the cloud computing megacorps.

9front: indeed – apart from the odd “no OOP” (uh?) requirement, I see a lot in common with V, in that wish-list of theirs.

Porting V to Haiku was not too much trouble a few years back BTW (and thus might still be feasible), if you do make the jump to coding and decide that you’d rather code there instead of on a Linux host.

Adding some sort of bindings to V to make it ‘talk’ to the Genode or Be APIs would be an interesting twist for sure. I have quite limited experience in V bindings, mainly related to ImGUI, Nuklear, SDL, if even that… But those are ‘custom’ widgets toolkits, whereas using native widgets would have my preference.


When it comes to picking technology and evaluating corporate sponsors one has (unfortunately) to be pragmatic… At least if you want to put food on the table. But I can think of at least one instance when my “penny-less tree-hugger” side was right ^^ .
That instance was when I was thinking of jumping ship from “Be2” and looking for a new home, and pondering the gap between Fuschia/Zircon and Genode/Nova. The former had some things going for it, on the rational and emotional side (several ex Be engineers were heading it, it had some conceptual ideas that seemed nifty, etc). But I eventually settled with Genode as it was more “here and now” (no hype/vaporware, no need for a VM: download, compile, test on actual bare metal, run classic Doom and so on ^^) and had concepts that were even more revolutionary, as I paged through the Genode Foundations PDF doc. Fuschia is pretty much dead now, so obviously I’m glad my “luddite” side won that inner debate back in 2018 ^^

1 Like

Perhaps also related to “gut feelings”, V looks promising, but I became aware of a possible whiff of toxic leadership surrounding the project. Nim by contrast seems to fill a similar niche and often comes up in discussions with those seeking an easier alternative to C++ within Haiku. I would probably be more likely to have a go with that.

Wow, is that a hostile article ^^
If I wasn’t already maintaining a (small) vweb project (to be migrated to veb soon) that would definitely drive me away from it screaming, never to look back again ^^
Beneath all the ad hominems the author does seem to have a point (or ten) though. Well that should be easy to validate since he gives his homework (repro examples and version of V used to repro). If they repro then that’d be a show stopper for using it in production: memory management must be flawless IMHO.

Anyway that’d confirm the first impression I had a few years ago: the V language can be the first choice for some people and some (small) projects, including for learning programming, but is not ready for prime time/production. As the versioning implies, it’s at 0.4, not 1.0… V will definitely need heroics to implement all of its roadmap and to fix all its bugs, no contest here. And heroics are not in the cards in the “brave new world” that is unfolding in the West, I’m afraid. People are more and more into survival mode. One can’t be excessively altruistic with an empty stomach.

And even if they reach version 1.0 and hit all their design goals, their design choices might not allow them to scale to big projects (I want deterministic ctors and dtors gosh dang it, not “ersatz” !).


Re. Nim, I guess you can’t go wrong with any newer language that has decent support on your target OS. Well one risk which is common to ‘hobby’ languages is, will they still be around in five years ?

There’s a comparison of Nim and V at the bottom of this page: It seems that Nim is not quite in the same family as V and Go, it has a different philosophy. I’d have to check what exactly “significant whitespace” means – it could be something scary or something harmless. If you are okay with the Nim ‘way of things’ then you might very well have a blast (or at least “have a good time”, let’s not make it sound like programming is more sexy than it really is ^^). Whichever way to go, learning to code with a modern language is never something you get to regret as completely wasted time, because the fundamentals are more or less the same for most programming languages. You can take (part of) the learned knowledge to other languages later in your coding life. Don’t procrastinate too much on the choice of language and start writing your first lines of code, you might get hooked (and learn enough to then decide exactly which language is for you).

1 Like