Hacker News new | ask | show | jobs
by __d 2428 days ago
A browser engine is, I think, the main impediment to most non-mainstream operating systems being "useful" in a day-to-day sense.

It's just a massive amount of work, with literally millions of lines of code required, whereas a basic operating system is easily under 100k SLOC.

Plan9 and Inferno suffer from this. Haiku suffers from this. And Oberon is has the same issue.

2 comments

I don’t think a lack of a browser was an impediment for Plan9 nor Oberon when you look at when they were released. It was more likely the momentum was already behind UNIX and similar platforms. Enterprises already had solutions to hard problems and weren’t willing to take a gamble on something new.

As for the desktop market, BeOS has a browser and that still failed. SkyOS had a browser and failed. AFAIK Haiku has had a Firefox port for several years as well (albeit I make no statement about how stable nor bug-free it might be).

When you have Microsoft and Apple heavily promoting their platforms, even going so far as to give educational institutions massive discounts knowing they’re indoctrinating future customers, it strikes me that the only way to achieve household success with anything new is with massive corporate backing and a decent chunk of good luck too. So personally I’d define Linux as an anomaly.

I also think you’re not making a fair comparison where you compare lines of code in a “basic” operating system to a fully featured modern browser. But I go into more details on that in another post further down.

I agree -- a browser wasn't needed at the time. But without one, they're not practical for use as a desktop/laptop/phone OS today. And I also agree that a browser is not sufficient (as you cited, BeOS/Haiku, etc) but it is necessary.

As a related example, NewtonOS (Apple's MessagePad/eMate OS), did have a couple of HTTP 1.1 / HTML 2.0 browsers. But it wasn't able to support SSL/TLS, nor JavaScript, and as a result using one today is impractical.

The world has moved on since the 90's. Some evolutionary lines had features that were lost.

> So personally I’d define Linux as an anomaly.

And, given the forces you describe, the ecosystem probably had room for at most one anomaly.

I think you're right, but I don't understand why creating a browser engine is such a monumental task. Is page layout really so complicated?
Page layout need not be complicated if you write it yourself in simple imperative code, for your own website.

But parsing the different standards of HTML and deal with invalid HTML in the "appropriate" way must be a lot of work. And implementing CSS to work with existing websites, and making it efficient, must be a PITA.

Much of that complexity was created in the name of discoverability. Given the amount of money that was spent on search and looking at the quality of search results nowadays, I'm not so sure.

In general the idea is to separate structure from style, and to allow developers to specify style more declaratively to enable them to make sites quickly. But I'm not positive that that worthwhile goal implies that the logic should be implemented in the browser. IMO it should be implemented in downloadable library code.

It strikes me as completely insane that it's more complicated to write a browser rendering engine than a whole OS. But I suppose the proof is in the pudding and the fact that there are so many more hobby OSs than hobby browsers must be testament to this fact.
> It strikes me as completely insane that it's more complicated to write a browser rendering engine than a whole OS.

There was once a programmer who was attached to the court of the warlord of Wu. The warlord asked the programmer: “Which is easier to design: an accounting package or an operating system?”

“An operating system,” replied the programmer.

The warlord uttered an exclamation of disbelief.

“Surely an accounting package is trivial next to the complexity of an operating system,” he said.

“Not so,” said the programmer, “when designing an accounting package, the programmer operates as a mediator between people having different ideas: how it must operate, how its reports must appear, and how it must conform to tax laws.

By contrast, an operating system is not limited by outward appearances. When designing an operating system, the programmer seeks the simplest harmony between machine and ideas. This is why an operating system is easier to design.”

The warlord of Wu nodded and smiled. “That is all good and well,” he said, “but which is easier to debug?”

The programmer made no reply.

The Tao of Programming, Geoffrey James, 1987

It depends where your benchmark is.

Writing a browser that passes acid tests and supports all the standards (old and new) as well as the sites that aren’t standards compliant but users might still expect it to work; that is an insane hard task. But building a console browser that supports a subset of standards and has no Javascript support is a much easier job (read: “easier” as in relative to the former task).

Much like building a kernel + CLI shell is easier than building a fully multi-tasking OS with GPU accelerated GUI compositing, stable ABIs, modular driver model, and full support for 99% of common hardware.

The biggest problem is that browsers are actually virtual machines nowadays, so you end up implementing two OSes.