stephtr / qalculator

Progressive Web app for calculating the awesome way
https://qalculator.xyz/
23 stars 4 forks source link

Modularizing libqalculate-wasm and publishing on npm #19

Open lrq3000 opened 10 months ago

lrq3000 commented 10 months ago

Hello again Stephan!

I would like to suggest to modularize libqalculate-wasm into its own repo (it can be linked here with a submodule, so for this repo here it can be just the same as now, no difference in building process of qalculator), and to publish a precompiled version in GitHub Releases and if possible on NPM, so that other projects can use it very easily by reusing a centralized version online.

For example I am building a calculator to avoid dosage miscalculations for babies and newborns (a long time project of mine, but the tech wasn't there before). With libqalculate-wasm, it could theoretically convert transparently most dosages reliably.

I know there are lots of other libraries already available, but why not use libqalculate-wasm now that it exists? ;-)

Thank you for considering my suggestion!

stephtr commented 10 months ago

That would be interesting! I'm a bit unsure about the API though. Exposing the whole Calculator object might be a bit overkill and also complex in usage. Have you had a look at the interface I wrote for qalculator (calc.cc)? I guess that would be sufficient for your use case?

lrq3000 commented 10 months ago

Oh i didn't see this interface but yes it would be more than enough for the needs of my app indeed, the calculate function greatly simplifies using libqalculate indeed!

stephtr commented 10 months ago

I hope I'll have time for it over the weekend :)

lrq3000 commented 10 months ago

Wow that would be awesome, but no pressure, my use case is not urgent, if it ever happens I would be super happy :D Thank you very much for doing this!

lrq3000 commented 9 months ago

Dear @stephtr , just to let you know that by chance I stumbled on another port of libqalculate to wasm, and interestingly it supports plot(), although it is much less feature rich and out of date compared to your implementation. Maybe merging here some interesting bits there may be interesting?

https://flaviutamas.com/qalculate-wasm/

Source-code: https://github.com/flaviut/qalculate-wasm