February 17, 2022

Why LibreOffice in WebAssembly is a Big Deal

Matt Butcher Matt Butcher

qt libreoffice openoffice webassembly

Why LibreOffice in WebAssembly is a Big Deal

Earlier this week, demos began to circulate of LibreOffice (using the QT graphical toolkit) compiled to WebAssembly and running in the browser. This comes after Thorsten Behrens of Allotropia gave an interview announcing WebAssembly support in LibreOffice . The stories trended to the top of Hacker News. And this came hot on the heels of the Fosdem session explaining WebAssembly for LibreOffice. Why all the fuss?

For us at Fermyon, we see LibreOffice’s move as a strong indicator that WebAssembly is now poised to enter the practices of mainstream developers. And while Fermyon is focused primarily on the cloud side of things, we do think that (just as with JavaScript and Node.js) both sides of the network connection will benefit from pervasive use of WebAssembly.

The Underwhelming Promise

For whatever reason, WebAssembly has been undeniably slow to catch on in the browser. Two years ago, when we started investigating its potential, the most frequent usage we observed in the wild was, tragically, bitcoin miners running in the browsers of unsuspecting site visitors.

One might be tempted to point fingers at the specifications, which seem to have crawled along. DOM support has lagged, as have key features like threading and garbage collection. But this is deflecting attention from the more likely: the value proposition has just not hit the average “full stack developer”’s sweet spot. In other words, replacing JavaScript code with compiled (for example) Rust code has not been a valuable enough story.

Now the tide seems to be turning. And LibreOffice is a sign that WebAssembly’s moment is arriving.

QT and LibreOffice

QT is a mature and stalwart user interface toolkit behind many Linux desktop projects. LibreOffice uses the QT toolkit for its graphical user interface.

QT has had WebAssembly support for quite some time. I first noticed it when I discovered an online version of an image slicing utility called PosteRazor. And the QT APIs have been improving over time. A handful of small WebAssembly tools have been built using QT. But LibreOffice represents a different trend.

LibreOffice is an established, well-storied codebase with millions of lines of code.

It’s not a toy, not a “Hello World” program, not a high-performance micro-library, not a utility… it’s a full-fledged suite of tools. And because of this, LibreOffice in WebAssembly represents a major victory for a technology that has been considered fringe. LibreOffice is “brownfield” code that just leap-frogged from the past into the future.

Is This the Resurgence of LibreOffice?

The folks at Allotropia very likely have a plan. What it is, though, we can only speculate based on the previously mentioned interview in which they referred to the project as LOWA (LibreOffice in WebAssembly). Thorsten Behrens concludes his interview with a hint:

There’s just a ton of work still to do, to make the LOWA LibreOffice really usable, so that will keep us pretty busy this year.

One does not put a year of work into demo-ware. So we at Fermyon suspect that today’s preview may in fact be the first step toward something new. As users of Google Docs and o365, we would certainly welcome an office solution that provided nearly 100% parity between the online version and the desktop version. We may be a year from seeing this come to fruition, but the potential here is undeniable.

But the victory extends beyond the story of an office platform. WebAssembly can be used for large applications! It has now been demonstrated. WebAssembly can be a vehicle for bringing mature code bases to the cloud without massive rewrites. Again, now demonstrated! LOWA is an example of a deep investment in WebAssembly. (If you have been paying close attention to WebAssembly, you’ll know that MS Excel in o365 has compiled some legacy C code to WebAssembly in order to avoid a costly rewrite but on a much smaller scale. One could speculate on whether the o365 team may also be looking at this path forward.)

Fermyon’s immediate interest in WebAssembly is cloud-oriented. But that doesn’t mean that we think the LibreOffice news is in any way irrelevant to us. WebAssembly is an ecosystem. We are just as eager to see venerable office suites, useful C libraries, and new programming languages come along.

Concluding Unscientific Postscript

Ruby was a decade old before it caught on. What was the magic bullet? We all know the answer: Rails. JavaScript’s first decade was a struggle until a few crucial browser innovations and Node/NPM gave JS developers new super powers. The fact that WebAssembly’s initial adoption was not fast and furious does nothing to diminish its value. A rise in new applications of WebAssembly, and new paradigms that work better with WebAssembly may be the boost that Wasm needs to step into the limelight.

We certainly think so. And LibreOffice brings WebAssembly one step closer to its shining moment.




🔥 Recommended Posts

Quickstart Your Serveless Apps with Spin

Get Started