'It's where the industry is heading': LibreOffice team working on WebAssembly port

Second attempt to run entirely in the browser – but nothing works yet

The LibreOffice team has been working on a port to browser-hosted WebAssembly, and hopes for a working demo by summer 2021. "It's the way the industry is heading," said Document Foundation board member Thorsten Behrens.

Browser-based versions of the open-source office productivity suite already exist in the form of Collabora Online and LibreOffice Online (LOOL), mainly developed by Collabora.

The Document Foundation, steward of the LibreOffice project, said that it is "not planning to develop and fund a cloud solution similar to existing products from Google and Microsoft" because this is "not in line with the original mission of the project."

Instead, it has provided the code for other providers to deploy, although the foundation added that this code is missing essential pieces, such as authentication, which are down to the provider.

A board deputy at TDF contacted us to emphasise the experimental nature of the project. “A port to WebAssembly is at present being independently developed by an organisation that is a member of the ecosystem but it hasn't been yet evaluated to be included in the road map or as being a joint project with TDF,” he said.

Speaking at the FOSDEM 2021 open-source developer event earlier this month, Behrens said LOOL is based on the HTML5 Canvas element that displays the document, but that "all the rendering, all the interaction with the document, all the editing" happens on the server.

This Qt Mandelbrot demo was successfully built with the gbuild LibreOffice build system; it is the only thing so far that runs

This Qt Mandelbrot demo was successfully built with the gbuild LibreOffice build system; it is the only thing so far that runs

This has the advantage that the client code is lightweight and that the document lives on the server, which is good for security and for collaborative editing, because there is only one document instance. The disadvantages? There is "no offline mode, it is relatively expensive to host, and there is no peer-to-peer editing."

Scaling LOOL is non-trivial, Behrens said, if you want to run it "beyond a handful of users."

Another snag is that the code for the online version is in a separate repository from that for the cloud version, but they have a lot in common, and keeping the two in sync with updates is challenging.

2015 was too early... but tech's more developed now

Behrens observed that technology advances mean that a smartphone today is more powerful than a typical PC back in the '90s, when much of the code in the core of LibreOffice (originally Star Office) was first developed.

He should know – his bio states that "Thorsten was part of the OpenOffice.org project almost from the start when he joined the then-Sun Microsystems development team back in early 2001."

That being the case, why not run LibreOffice "in the browser, all of it, using this nifty technology called WebAssembly? It's where the industry is heading," said Behrens.

The idea is to use browser APIs where possible, removing code from LibreOffice itself, and compile the core code to WebAssembly (Wasm). LibreOffice uses the Qt library and Qt for Wasm exists, using the Emscripten compiler, with the docs stating that "this format is nearly as fast as native machine code, and is now supported by all major web browsers."

LibreOffice 7.1 beta introduces new features including outline folding in Writer

LibreOffice 7.1 beta boasts impressive range of features let down by a lack of polish and poor mobile efforts


The team tried this before, said Behrens, in 2015, but could not get it to work. "It was too early, the technology was too young, Emscripten could not even do exceptions properly," he said. "Now it seems the stars are much more aligned. Nothing really missing any more, even threading support is kind-of there."

There is an issue with sharing memory between threads since browsers disable the JavaScript SharedArrayBuffer, used for this purpose, because of speculative execution security concerns, but there are workarounds using service workers and message passing. Writer, which is the team's initial target, was originally written as a single-threaded application. There are also issues with the size of the code. It is not feasible to download hundreds of megabytes of binary Wasm so the aim is to squeeze Writer into 20MB to 30MB of Wasm.

The team has had some success compiling the code, but unfortunately it mostly does not work, said Munich-based Jan-Marek Glogowski, who is working on the project. "The only thing that is runnable is a Qt5 demo which I ported to gbuild," he said (gbuild is the LibreOffice build system, based on the GNU Make tool.)

Youtube Video

Details on what did not work can be found in Behrens and Glogowski's talk here and in the readme document here. It is impossible to compile dynamic modules, plugin code causes problems, the compiled binary is still much too large, and debugging is difficult, said Glogowski.

"Right now we're still in the early stages," Behrens acknowledged. Despite these issues, Behrens said that "we hope to have vcldemo running" very soon – this being a demo of the LibreOffice Visual Class Library which displays the widgets used by the suite. He also aims to have Writer rendered interactively on an HTML5 canvas by summer. Behrens said that one of the advantages will be end-to-end encryption, which is not possible with LOOL, and said that the team hopes to demo this before the end of the year.

A WebAssembly version of LibreOffice would meet different needs than the current LOOL and in principle would enable cross-platform use of the suite without having to install software and without requiring a hefty server application – all the functionality would be in the browser.

Opinions on whether Wasm is the future of browser applications will vary, but reliable ways to run LibreOffice outside the context of a PC or Mac could potentially be important to the project's future. ®

Narrower topics

Other stories you might like

  • 381,000-plus Kubernetes API servers 'exposed to internet'
    Firewall isn't a made-up word from the Hackers movie, people

    A large number of servers running the Kubernetes API have been left exposed to the internet, which is not great: they're potentially vulnerable to abuse.

    Nonprofit security organization The Shadowserver Foundation recently scanned 454,729 systems hosting the popular open-source platform for managing and orchestrating containers, finding that more than 381,645 – or about 84 percent – are accessible via the internet to varying degrees thus providing a cracked door into a corporate network.

    "While this does not mean that these instances are fully open or vulnerable to an attack, it is likely that this level of access was not intended and these instances are an unnecessarily exposed attack surface," Shadowserver's team stressed in a write-up. "They also allow for information leakage on version and build."

    Continue reading
  • A peek into Gigabyte's GPU Arm for AI, HPC shops
    High-performance platform choices are going beyond the ubiquitous x86 standard

    Arm-based servers continue to gain momentum with Gigabyte Technology introducing a system based on Ampere's Altra processors paired with Nvidia A100 GPUs, aimed at demanding workloads such as AI training and high-performance compute (HPC) applications.

    The G492-PD0 runs either an Ampere Altra or Altra Max processor, the latter delivering 128 64-bit cores that are compatible with the Armv8.2 architecture.

    It supports 16 DDR4 DIMM slots, which would be enough space for up to 4TB of memory if all slots were filled with 256GB memory modules. The chassis also has space for no fewer than eight Nvidia A100 GPUs, which would make for a costly but very powerful system for those workloads that benefit from GPU acceleration.

    Continue reading
  • GitLab version 15 goes big on visibility and observability
    GitOps fans can take a spin on the free tier for pull-based deployment

    One-stop DevOps shop GitLab has announced version 15 of its platform, hot on the heels of pull-based GitOps turning up on the platform's free tier.

    Version 15.0 marks the arrival of GitLab's next major iteration and attention this time around has turned to visibility and observability – hardly surprising considering the acquisition of OpsTrace as 2021 drew to a close, as well as workflow automation, security and compliance.

    GitLab puts out monthly releases –  hitting 15.1 on June 22 –  and we spoke to the company's senior director of Product, Kenny Johnston, at the recent Kubecon EU event, about what will be added to version 15 as time goes by. During a chat with the company's senior director of Product, Kenny Johnston, at the recent Kubecon EU event, The Register was told that this was more where dollars were being invested into the product.

    Continue reading

Biting the hand that feeds IT © 1998–2022