Qalculate / libqalculate

Qalculate! library and CLI
https://qalculate.github.io/
GNU General Public License v2.0
1.79k stars 144 forks source link

Running Qalculate in the browser #225

Open flaviut opened 3 years ago

flaviut commented 3 years ago

Hi, I've done some work on getting Qalculate running in the browser at https://github.com/flaviut/qalculate-wasm. You can test it at https://flaviutamas.com/qalculate-wasm/

I've only had to apply one patch, at https://github.com/flaviut/qalculate-wasm/blob/master/libqalculate-popen.patch, since emscripten doesn't support popen.

I'd like to hear some thoughts, especially as far as:

Performance is actually quite good:

hanna-kn commented 3 years ago

Compiled definitions without GIO (or any other requirements) has now been implemented.

popen is only used when invoking Gnuplot. I assume that it won't be possible to run Gnuplot in the browser. The patch disables checking for the presence of gnuplot in path, which seems to be the correct way to handle it in the browser version. Ideally this should be done with an #ifdef statement instead of a patch.