Users of Firefox may have encountered app crashes and faced the Firefox Crash Reporter screen, which sends crash reports back to Mozilla for analysis. The Firefox Crash Reporter is a separate app from Firefox but bundled in the same installation package. The reason for this separation is that when Firefox crashes, the Crash Reporter app can continue working independent of Firefox.
However, the Crash Reporter has been around for a long time (backed by C++ and partly Objective-C for the Mac version). Some parts are becoming outdated, such as the Mac version generating binary files using outdated tools that even Apple has stopped using. The original code has become more burdensome to maintain over time.
Recently, Mozilla announced that they have rewritten Firefox Crash Reporter in Rust for various reasons, such as memory safety at the language level, a robust type system, and standard library making code maintenance easier.
The new look of Firefox Crash Reporter remains similar to the old one. While building the new Crash Reporter may seem straightforward since it has only one screen, Mozilla’s requirements impose many limitations. For example, a minimal external code or library usage is a must to keep the app small and uncomplicated for easy backward debugging. These conditions make it impossible to create a cross-platform GUI using external libraries. Hence, Mozilla had to rely on its own solutions.
Mozilla’s approach also aims to minimize platform-specific code. Therefore, the GUI creation requires a central GUI abstraction that uses a declarative structure and is then transformed into native GUI on each platform using platform-specific GUI building kits.
Linux utilizes GTK+ 3, which is considered to have the least issues due to its relatively modern, declarative approach. macOS uses Cocoa (AppKit and Foundation frameworks) and faces challenges with a significant amount of Xcode-generated GUI code, requiring manual GUI creation without Xcode for certain components like keyboard shortcuts. Windows uses the Win32 API, known to be the most challenging platform as it is very old and lacks extensive abstraction support, requiring a significant amount of custom code.
This article contains many other details that those interested in building apps with Rust can explore further.
TLDR: Mozilla has rewritten Firefox Crash Reporter in Rust to improve memory safety and code maintenance, requiring minimal platform-specific code and utilizing a central GUI abstraction. Each platform has its challenges in adapting to these changes.
Leave a Comment