Exposing system APIs like ErrorOr (like the Rust Result or the Maybe monad) resolves an entire class of bugs (take fork/kill/-1 as an example [1]) as well as ambiguity like "do I check the return value for the reason, or do I check the magical errno variable?". Dropping general OS compatibility also allows for other changes, like object oriented interaction with the GUI system and other system libraries instead of relying on having the namespacing happen in the name of a function call.
I know SerenityOS won't ever replace any operating system we use today, but it's a nice demonstration of the API features we could all be using.
Sometimes I wish Windows' APIs were more POSIX-like, but Win32 has some pretty useful functions built right into the OS that you'd need to introduce DLL/dependency hell/static compilation for if you're trying to stick to POSIX only APIs. Think common concepts like "the clipboard" or "the current resolution of a display" without needing to link to a library or access a file like /dev/fb0 (is there a /dev/fb1? when do you use it?).
Mobile platforms (Android, iOS) with special lifecycles also allow for things like "the app resumes where you left off" and "the app suspends to disk when the system is under load" natively without requiring developers to build their own save/restore state mechanisms. Imagine having to build a system like that on your average Linux desktop with mere POSIX APIs, you'd go crazy with the complexity required.
Perhaps what programs runnong on Unix-based operating systems really need is a wrapper around POSIX and its low-level implications. GTK and Qt provide many such APIs for free, for example, including stuff like networking and other I/O. GTK comes with its annoying particularities (CSD, and all the other GNOME decisions) and Qt licenses are either VERY free or VERY expensive, making them incompatible with other projects.
With the Linux space transitioning from SystemV+ALSA/Pulse+X11 to systemd+PipeWire+Wayland, perhaps the space is ripe for a new, more modern wrapper library for native languages.
[0]: https://github.com/SerenityOS/serenity
[1]: When fork() fails, the call returns a negative number. When you try to kill() a PID of -1, you kill every process your current UID has the permission to kill. Programs failing to fork, shutting down, and killing what they thought was a fork()ed process can accidentally end up killing all the open applications for a user.
It's easy to point out an example of unreadable code in any language because every language has their weird programmers. If you stick to modern tools with strict linting and good design, you can write perfectly readable C++ code.
I don't use C++ often, but I find the code over at https://github.com/SerenityOS/serenity to be more legible than many large code bases in other languages.
- SerenityOS [0], they do get some donations, but nothing close to the Linux Foundation, Wikipedia, or Mozilla.
- MikroORM [1] if you'd like to support an ORM for TypeScript in the backend, again some donations, but nothing close to SerenityOS!
Mild nitpick but "web browser" and "rendering engine" and "JavaScript" are different.
Anybody can take WebKit and do some cool stuff on top in the UI and call it a "web browser".
At the end of the day, without patching to the HTML/CSS rendering engine, it's going to perform like every other WebKit based browser, right?
https://en.wikipedia.org/wiki/Comparison_of_browser_engines
I know Chromium uses Blink and not WebKit now.
Looks like Ladybird is based on https://en.wikipedia.org/wiki/SerenityOS "LibWeb"
That's all just rendering. You need to hook a JavaScript engine up to the rendering engine as well (with glue to the DOM from what I know?)
Chromium is Blink + V8, right?
Does Ladybird SerenityOS Libweb also do JavaScript?
> Browser with JavaScript, WebAssembly, and more (check the spec compliance for JS, CSS, and WASM)
It does. https://github.com/SerenityOS/serenity https://github.com/SerenityOS/serenity/tree/master/Userland/...
Not only is the code itself structured much more pleasantly than I ever suspected possible in C++, huge parts of it were also recorded while they were being written (see https://www.youtube.com/c/AndreasKling) so you can see and hear the process that led to the final product.
Some of the code is quite gnarly, which is to be expected from a repo containing an entire operating system, containing everything from the kernel to a bespoke web browser.
However, as SerenityOS isn't trying to be a UNIX clone, its C++ oriented APIs are a nice breath of fresh air compared to the barebones C that Linux and friends use.
Michael Penn https://youtube.com/c/MichaelPennMath: Covering calculus, number theory and more. Classic black board lectures, highly enjoyable.
Andreas Kling https://youtube.com/c/AndreasKling: Livestreaming development on SerenityOS (https://github.com/SerenityOS/serenity)
I'm on Ubuntu, and it looks like I need to upgrade to 22.04 before I can experience the build process for myself.
https://packages.ubuntu.com/search?suite=all&arch=any&search...
The repo itself is shockingly tiny: https://github.com/awesomekling/ladybird. Looks like it needs https://github.com/SerenityOS/serenity as well. https://github.com/SerenityOS/serenity/tree/master/Userland/... is 100kLoC which is also surprisingly small.
This OS has that look and feel of Windows 2000
That's actually being done in the Serenity OS project! HTML renderer, JS interpreter, and Web Browser, from scratch:
https://github.com/SerenityOS/serenity
https://www.youtube.com/playlist?list=PLMOpZvQB55beChggmvk-s...
https://www.youtube.com/playlist?list=PLMOpZvQB55be0Nfytz9q2...
Just to be clear, while I started the project, it's since been hacked on by hundreds of people (we're well over 500 contributors on GitHub) and it's by no means a solo project anymore! https://github.com/SerenityOS/serenity
To give a data point, in 2021-era C++ it's approximately 3 years with a very large part of it being done by a single person (https://github.com/SerenityOS/serenity). How long would that take with python ?
I love the idea of doing more operating system experiments on RPIs just because of the availability & consistency of the platform. You don't have to worry about thousands of drivers for the most part, plus if you're using the RPI 400[1], basically everything is included in the keyboard!
Rust seems like a good way to get people involved as well, because of it's innate following. Excited to give this tutorial a try.
[0] https://github.com/SerenityOS/serenity [1] https://www.raspberrypi.org/products/raspberry-pi-400/
For a project that seems to be focused around something visual, it's strange to me that there's not even one screenshot on the home page.
The github page [1] does at least have one.
1. https://github.com/SerenityOS/serenity
edit: the screenshot is now on the home page! That was such a fast turn around.
Graphical Unix-like operating system for x86 computers.
SerenityOS is a love letter to '90s user interfaces with a custom Unix-like core. It flatters with sincerity by stealing beautiful ideas from various other systems.
Roughly speaking, the goal is a marriage between the aesthetic of late-1990s productivity software and the power-user accessibility of late-2000s *nix. This is a system by us, for us, based on the things we like.
> SerenityOS is a love letter to '90s user interfaces with a custom Unix-like core. It flatters with sincerity by stealing beautiful ideas from various other systems.
> Roughly speaking, the goal is a marriage between the aesthetic of late-1990s productivity software and the power-user accessibility of late-2000s *nix. This is a system by us, for us, based on the things we like.
it did well enough that C stdlibs (at least MSVC's, LLVM's) and compilers (... pretty much all the big ones) are implemented in C++ and just export C symbols nowadays, likewise for newer OSes like Fuschia.
SerenityOS (https://github.com/SerenityOS/serenity) was written from scratch in two years in C++ and goes as far as having a custom web browser & JS engine. Where is the equivalent in C ? Where are the C web browsers, C office suites, C Godot/Unity/Unreal-like game engines ? Why is Arduino being programmed in C++ and not C ?
(Note: The serenityos.org website is pretty barebones, there's a lot more information over in the GitHub repo.[1])
I'm the principal author of the system, although it has grown quite a lot since it was first seen on HN back in March of 2019.[2]
The system now has its own HTTPS-capable web browser, JavaScript engine, and many other applications under development. Over 180 people have contributed changes and we there's active daily development.
My most recent project has been adding a userspace x86 emulator [3] to the system that provides the same kind of features as the famous Valgrind.
Happy to answer any questions about the system if anyone has them. Either way, thanks for checking out the system!
[1] https://github.com/SerenityOS/serenity
[2] https://news.ycombinator.com/item?id=19537807
[3] https://twitter.com/awesomekling/status/1285685093961469955
[1] https://youtube.com/c/AndreasKling/ [2] https://github.com/SerenityOS/serenity
you cannot make useful comparisons with "Linux alone".
See for instance SerenityOS (https://github.com/SerenityOS/serenity) : in one year and a few months it went from zero to full-blown C++ OS with graphical shell, userspace, and a dozen apps (https://github.com/SerenityOS/serenity/tree/master/Applicati...)... in 140kloc.
Of course we'll never know how Linux would have turned out if it had started today with modern C and modern computing power, but it does not seem out of this world that C++ is a more productive language than C by a non-negligible amount.