The programming challenge that is a modern browser
Writing and maintaining a modern browser is probably one of the most challenging programming projects you could ask for; it has to deal with inherently hard problems and a large scale.
Large code bases generally need abstractions to be tractable, so one way or another a browser's code is likely to contain a large number of internal abstractions. Some will be contained with a subsystem (if all goes well), while others exist at the boundaries between subsystems. Because the concerns about memory usage, CPU usage, concurrency, and responsiveness to asynchronous events are global ones, they may leak through much of the codebase, which adds its own complications.
(For instance, a browser that cares about CPU usage (and network bandwidth) may want to abruptly stop a relatively large number of things the moment you close a tab.)
The challenges of browsers and browser development effectively preclude a number of language technologies. For one prominent example, implementing a browser in a garbage collected language may get you a number of valuable things, but it probably results in too much memory usage to be viable (especially when faced with perverse inputs, which you'll eventually hit).
(None of this is new and it may well all be well known, but today I wanted to write it down for reasons outside the scope of this entry.)
Comments on this page:Written on 20 October 2022.