[sword-devel] Sword and WebAssembly

Greg Hellings greg.hellings at gmail.com
Tue Nov 17 21:54:20 EST 2020

I looked into it back in the asm.js days and, at the time, couldn't even
get the asm.js stuff to work. I haven't touched it since WebAssembly came
along and seems to have really standardized things. I've heard of some very
complex things being transpiled into WASM, that gives great hope that
something as simple as SWORD can be, as well. Strictly speaking, libsword
has no hard dependencies. Only optional ones on cURL, CLucene, etc.

The hardest part is probably going to be fetching down the modules.
WebAssembly would need to have access to some sort of file system or
virtual file system, and you're looking at anywhere from a few dozen KB for
the smallest up to in the vicinity of a meg or two for many of them. The
biggest ones are image based and run to a couple hundred megabytes. I don't
know what WASM does for trapping file system calls or the limits on web app
storage. Most browsers, when looking at a website, are limiting it to
5-10MB per site. That's not going to go very far for SWORD data.

In short - no horror stories. You'll probably make off pretty well with it.
You'll just want to be sure you know how it's storing downloaded resources
and manage that, if necessary. Same thing if you build it with CLucene
dependency. That will need to store its indexes somewhere, but the space
isn't as big as most of the modules themselves. Just another file
management thing to consider.


On Tue, Nov 17, 2020 at 8:05 PM Loren Burkholder <
computersemiexpert at outlook.com> wrote:

> First and foremost: I promise that I will try to not bug y'all with any
> more questions for a while (at least, not with questions not on this topic).
> Does anybody know if Sword works with WebAssembly? The reason that I ask
> is here: https://lorendb.github.io/TotalReqall/wasm/TotalReqall.html.
> (Note that this doesn't have Sword in it.) I want to continue providing a
> WASM binary, but in order to do that, I will need to get Sword working on
> WASM. Any thoughts, anecdotes, or horror stories?
> Loren
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://crosswire.org/pipermail/sword-devel/attachments/20201117/cda60cc8/attachment.html>

More information about the sword-devel mailing list