Hacker News new | ask | show | jobs
by BlackLotus89 1627 days ago
Gecko and servo are both not easily embeddable.

Servo isn't a finished rendering engine yet and the browser I saw that could exclusively use servo was not compliant enough and since mozilla fired the servo team there is no certain future for it anymore. Projects that tried to make servo embeddable are all dead and gone (see https://github.com/paulrouget/servo-embedding-example for example)

So yeah last time I tried to use gecko I failed and didn't try again (years ago) nobody is willing to do the work and mozilla seems to focus more on other stuff...

3 comments

That non embeddability is probably also a major reason why there isn't a significant node competitor based on spidermonkey. I get wanting to focus on Firefox as a whole, and that making components more independent can add quite a bit of work. But at the same time, if it was easier to use gecko in other browsers, and spidermonkey as JS environment outside the browser, I wonder if that would increase usage of and interest in the underlying technology.
Spidermonkey is quite embeddable by itself [1]. On Linux things like polkit, couchdb, mongodb use it. Still, the compilation process seems to download the whole firefox tarball and only compiles the JS related parts [2, 3].

[1] https://spidermonkey.dev

[2] https://archlinux.org/packages/extra/x86_64/js78/

[3] https://www.linuxfromscratch.org/blfs/view/svn/general/js78....

And the fact that polkit uses it is why debian and ubuntu use an ancient version of polkit. And fwiw, there is an effort to replace spidermonkey in polkit with something else, like duktape.

Also js78 uses the version of spidermoneky from Firefox 78. The current Firefox ESR is 91 (released in august), but I don't see any js91 package, and https://github.com/mozilla-spidermonkey/spidermonkey-embeddi... still says to use the 78 ESR. Note that ESR78 is end of life and no longer receives security updates.

And from what I understand, there is no attempt at backwards compatibility in the spidermonkey interface, so each upgrade requires a lot of changes to the embedding program.

Yes, it is possible to embed spidermonkey, but there are a lot of challenges.

We embedded spidermonkey as the JavaScript engine for the prime video application on games consoles and smart TVs when I was at Amazon (5 years ago+ not sure if they still use it). I've not embedded any other JS engines, but it wasn't too bad to embed.
Actually, I just realised what I said above was slightly inaccurate, we also built an application that embedded CEF, so I technically have embedded another js engine (that was 7+ years ago though, and my memory is spotty).

CEF was also relatively straightforward to use. Both times we were embedding them in C++ applications.

This was the biggest fumble of the Mozilla strategy in the last 20 years. Instead of focusing on the developer market, particularly after the appearance of WebKit, they bet (half) the farm on a quixotic quest to build a mobile OS from scratch. By attempting to gain a level of control that was always unlikely, they endangered their own survival.
I would have made that same mistake if I was making decisions for Mozilla at the time. It's such an elegant, logical and tempting ideal to turn the browser into the OS. Too bad it didn't work out.
Well, now we have PWAs. I'd be more than a bit bitter if I was a mozilla dev tasked with making those work on android/ios instead of on firefoxOs.
Good luck getting Apple to allow basic features like storage without weird limits, notifications, and the rest of the list. They killed Flash in favor of HTML5+JS and then decided for the walled garden.
KaiOS though has had success. If anything FxOS was ahead of its time and targeting a market too small.
Interestingly there was a (never finished) Node fork based off SpiderMonkey (https://github.com/mozilla/spidernode had to write a V8 shim on top of SpiderMonkey), and GNOME Shell and some GNOME apps are written on gjs which uses SpiderMonkey. I don't know if it's bad at embedding compared to V8, but it's definitely been done.
MongoDB embeds SpiderMonkey. Embeddability of SpiderMonkey is fine. It is Gecko that is the problem.
Interestingly, MongoDB switched from SpiderMonkey to V8 only to switch back a few releases later.

https://engineering.mongodb.com/post/code-generating-away-th...

I embedded it in https://digiguide.tv/products/windows.asp around 20 years ago.

Aside from thread-wrangling I thought it was trvial to embed.

> 32mb RAM and 8mb Disk Space.

I miss such numbers so much.

>since mozilla fired the servo team there is no certain future for it anymore.

When did that happen? It seems the managerial class has completed their takeover of Mozilla in the last few years. A real shame, since it basically cedes the entire web to Google.

>it basically cedes the entire web to Google

Refocusing on making Mozilla a viable entity without the need for cash splashes from Google is doing precisely the opposite. By diluting Google's financial control it ensures decision-making is both actually and ostensibly impartial.

Gecko is still a perfectly functioning browser engine. It's far easier to keep Gecko up to date with modern web standards than reinventing the wheel.

As nice as it would be to have a free and open source browser engine written in a memory safe language, I can't see there being a lot of money in it for Mozilla.

In 2013 Mozilla spent $197M on software development and $30M on general/administrative.

In 2020 it was $242M and $137M.

The future-focused servo team was not the place to cut a couple million.

It seems to me, that once a company reaches a tipping point of more than 50% non-engineers in upper management, it's the demise of the company as an engineering company, and it will slowly drift in the direction of being a technology holding company only.
I wouldn't be this cynical if everyone said the same thing to the Firefox OS back then. It turned out that Firefox OS did have much potential to countries with less mobile penetration, as observed from KaiOS's success in India.

Was the Firefox OS less future-focused than Servo? I don't think so, and given that Servo actually did survive long enough to give back to the mainline Gecko (in the form of WebRender and so on). It might or might not make actual sense to conclude that as the ROI shrinks, but it is always easier to claim the decision was wrong after that decision.

Well, many claimed that back when decisions were being taken. They could have scrapped FFOS much sooner than they did.

> Firefox OS did have much potential to countries with less mobile penetration, as observed from KaiOS's success in India.

Such "success" is inevitably fleeting. Eventually a "developing" market develops to demand more established and desirable products. Nokia had those markets under lock and key for a long time, back when EU/US had already moved on to iPhone-like products; but then consumers inevitably gravitated towards the fashionable.

> Nokia had those markets under lock and key for a long time, back when EU/US had already moved on to iPhone-like products; but then consumers inevitably gravitated towards the fashionable.

“fashionable” is the wrong word: it should be “functional”. Those old Nokia phones were very good at being phones but that's it — maybe a minimal messaging app, but anyone who used one knows just how limited those old mobile OSes were.

I think FirefoxOS was an interesting idea but there are really important thresholds you need to be able to hit and that was the critical error they made. There was no plausible way to grow the low-end feature phone market into a large enough business to get there when competing with cheap knock-off Android devices. If they'd started years earlier or gotten a major vendor on-board, maybe, but at their funding levels there was no way to make the numbers work and it was pretty clear at the time that this was a low-probability gamble.

Not if the platform can leverage its position to move upmarket, as Japanese, Korean and now Chinese manufacturers have.

  > In 2013 Mozilla spent $197M on software development and $30M on general/administrative.
  > In 2020 it was $242M and $137M.
  > The future-focused servo team was not the place to cut a couple million. 
Wasn't it just after 2013 when the replacement politically-correct CEO got quadruple the pay of the not-politically-correct engineer CEO?
That's a bit of an oversimplification, it's not like they had a choice between adequately funding R&D projects or Doing Political Correctness and chose the latter. Besides, remember that Eich was appointed in 2014 and had only a short stint at CEO, so I don't think you can attribute the 2013 figures to him

I think all of us on HN are a bit saddened about Mozilla cutting back on the Rust and Servo teams, but political-correctness isn't the reason behind that. Let's not turn this into one of those discussions.

They did give like a 10k grant for people to remove master/slave terminology from docs, so who knows what other PC work they were funding.
where can I find this statistics?
It happened when Mozilla laid off 25% of their staff. Servo was probably part of that because it was more of a research project than part of the core business.
Isn't their core business just helping google avoid anti-trust issues by being the "other" browser?
Well. Can't step on Google's embedability then.
OOF
I really hope that does not end up being the case because Firefox is better than ever in my opinion
Early attempts at embedding browsers in games were based on Gecko as well.

But it didn't become more widespread until a switch to Chromium was made, which made the entire process a lot simpler in both execution and distribution.

And there hasn't really been a need to revisit Gecko.

Wasn't Rust specifically invented to rewrite Gecko?
Rust was a personal project of Graydon Hoare. Mozilla jumped on the Rust train 3 years after its inception. https://web.archive.org/web/20160609195720/https://www.rust-...