To continue developing the Ladybird browser, it was decided to use the Swift language

The developers of the experimental Ladybird browser have announced their intention to use the Swift programming language as the main language for their project. Inclusion in Swift code is planned to begin in the fall, after the release of Swift 6 (the use of the Swift 5 branch is prevented by the connection to the old version of Clang, which is incompatible with the current Ladybird code base in C++). Thanks to the ability to combine code in C++ and Swift, Swift will be implemented gradually without rewriting existing code.

Swift was chosen due to a number of advantages, including memory-safe practices, protection against race conditions, modern syntax, and ergonomics. Of particular importance to the Ladybird team is Swift's object-oriented nature, which allows it to more accurately model web specifications and browser internals. The developers also note improving Swift support for non-Apple platforms and active work on compatibility with C++, which paves the way for the gradual introduction of the language into the project. Despite Swift's historical ties to Apple, the language is becoming increasingly independent, as evidenced, for example, by moving its repository to a separate organization on GitHub.

Andreas Kling, founder of the Ladybird project, shared his thoughts on Rust. According to Kling, while Rust has an impressive ecosystem, it is less suitable for developing long-lived programs with large, complex object graphs. Additionally, Kling described the Rust community as "toxic".

Let us recall that the Ladybird browser was initially developed as part of a project to develop the SerenityOS operating system. In June 2024, Andreas Kling, who once worked at Nokia and was developing Safari, decided to separate the browser project from the operating system project and devote his time entirely to its development. In July, the project received a $1 million donation and began forming the nonprofit Ladybird Browser Initiative.

The browser is written in C++ and distributed under the BSD license. The project is developing its own engine LibWeb, JavaScript interpreter LibJS, text rendering and 2D graphics library LibGfx, regular expression engine LibRegex, XML parser LibXML, intermediate code interpreter WebAssembly (LibWasm), library for working with Unicode LibUnicode, library for converting text LibTextCodec encodings, a Markdown parser (LibMarkdown), libraries with cryptographic primitives (LibCrypto, LibTLS), a library for working with LibArchive archives, libraries for playing audio and video (LibAudio, LibVideo) and the LibCore library with a common set of useful functions, such as time conversion, I/O and MIME type processing.

Ladybird uses a multi-process architecture, in which the process that creates the interface is separated from the processes that process web content, send requests over the network, decode images, and store Cookies. Handlers related to image decoding and network communication are separated into separate processes to enhance isolation and security. Each tab uses a separate web content processing process, isolated from the rest of the system. To build the interface, macOS uses AppKit, Android uses the native GUI creation API for this platform, and Qt is used on other platforms. The main web standards are supported (the browser passes Acid3 tests), HTTP/1.1 and HTTPS. The graphical interface is designed in a classic style and supports tabs.

Source: opennet.ru

Add a comment