News: 1613467805

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

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

(2021/02/16)


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 [1]Collabora Online and LibreOffice Online (LOOL), mainly developed by Collabora.

[2]

The Document Foundation, steward of the LibreOffice project, [3]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.

[4]

Speaking at the [5]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.

[6]

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 [7]Star Office ) was first developed.

He should know – [8]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 [9]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 boasts impressive range of features let down by a lack of polish and poor mobile efforts [10]READ MORE

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.)

[11]Youtube Video

Details on what did not work can be found in Behrens and Glogowski's talk [12]here and in the readme document [13]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.

[14]

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. ®

Get our [15]Tech Resources



[1] https://www.theregister.com/2020/12/03/libreoffice_71_beta/

[2] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2YCulyMxDfmn5SW0RiYrPkgAAAE0&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0

[3] https://www.libreoffice.org/download/libreoffice-online/

[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33YCulyMxDfmn5SW0RiYrPkgAAAE0&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0

[5] https://fosdem.org/2021/

[6] https://regmedia.co.uk/2021/02/15/qtdemo.jpg

[7] https://www.theregister.com/2004/10/06/ballmer_staroffice_charge/

[8] https://www.documentfoundation.org/governance/board/

[9] https://doc.qt.io/qt-5/wasm.html

[10] https://www.theregister.com/2020/12/03/libreoffice_71_beta/

[11] https://www.youtube.com/watch?v=xofn4wkEMKQ

[12] https://www.youtube.com/watch?v=xofn4wkEMKQ

[13] https://git.libreoffice.org/core/+/refs/heads/feature/wasm/README.wasm

[14] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44YCulyMxDfmn5SW0RiYrPkgAAAE0&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[15] https://whitepapers.theregister.com/

An Inevitable Consequence and Pleasant Result with Advancing Intelligence Sharing ‽ .

amanfromMars 1

The browser/browsers are the Operating System. And taken logically to its ultimate conclusion, that means you ....... and whenever you see/understand and can realise that, are you a relatively anonymous, and certainly at random times also an autonomous and almighty powerful source and/or force to be reckoned with/dealt with/engaged with ....... for the very simple, and easily understood reason, there be those who so realise that be the situation, that it drives them quite crazy and across to practices which have them having to hide and deny that deep and dark side of their interests which are decidedly and designedly destructive to others?

Get yourself hopelessly, helplessly entangled in that field and you had better know exactly what you should be doing, and hope that you haven't been doing anything awful, for there be others in there who certainly do, and would take no prisoners nor show any mercy to those worthy of divine retribution and natural justice for what they have done and would do.

If this is the future...

sreynolds

Then we're all fucked.

WHY?

Mike 137

Yes sreynolds, well said.

Yet another abstraction layer - metal, OS, browser, application. So more memory and higher processor speed needed, but no gain to the user and lots of security concerns.

It's the way the industry is heading

Gene Cash

So they're doing it because it's the latest fad?

Sounds like a great reason to waste coding resources!

Abominator

So another bloated web app that will need a browser running at 1.5GB, lots of threads and high local CPU usage. When will people learn. Don't even get be started on the cretinous UI's.

The only reason for this is to perpetuate the subscription pay for model which businesses love to create nice predictable steady revenues they can ratchet up.

some success compiling the code, but unfortunately it mostly does not work

Neil Barnes

Story of my life, I'm afraid...

Have a nice diurnal anomaly.