[GiNaC-list] GiNaC on the web
Vladimir V. Kisil
V.Kisil at leeds.ac.uk
Wed Nov 3 20:59:18 CET 2021
Dear Dani,
It seems to in an interesting work. GiNaC-on-Web may be
accessible on some common platform, which would be difficult or
impossible support otherwise. I think it can be useful!
Best wishes to you and your project,
Vladimir
--
Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/
Book: Geometry of Mobius Maps https://doi.org/10.1142/p835
Soft: Geometry of cycles http://moebinv.sourceforge.net/
Jupyter notebooks: https://github.com/vvkisil/MoebInv-notebooks
>>>>> On Tue, 2 Nov 2021 21:57:21 +0200, Dani Biró <danipro93 at gmail.com> said:
DB> Hey GiNaC people!
DB> First of all, thank you for this great library!
DB> I'm working on a web-based interface for GiNaC as a hobby
DB> project and I wanted to share it with you.
DB> You can try a demo frontend here:
DB> https://daninet.github.io/ginac-wasm/ Source code:
DB> https://github.com/Daninet/ginac-wasm
DB> There is no operator overloading in JavaScript, so I had to
DB> implement functions like add(), mul() for the different
DB> operations. The GiNaC commands are batched for faster processing
DB> because WASM <=> JavaScript calls are too expensive. The demo
DB> frontend includes a PEG-based parser written in JavaScript, but
DB> the embedded parser is also exposed through the parse()
DB> function.
DB> At this moment, the JavaScript/TypeScript API looks like this:
DB> const GiNaC = await initGiNaC('./dist/ginac.wasm'); const g =
DB> getFactory(); GiNaC(g.mul(g.numeric('2'), g.pow(g.symbol('x'),
DB> g.numeric('2')))); GiNaC(g.series(g.atan(g.symbol('x')),
DB> g.symbol('x'), g.numeric('5')));
DB> On my computer, the native ginsh is about 10x faster in
DB> estimating Pi with Machin’s formula compared to my WebAssembly
DB> port. That's because of the expensive C++ exception mocks
DB> generated by Emscripten, which compensate for the lack of native
DB> browser support for exceptions in WebAssembly. I estimate that
DB> the performance gap can be brought down to about 1/2 of native
DB> performance once the native exception instructions are getting
DB> wildly available in browsers.
DB> I plan to publish it on NPM (the JavaScript package library)
DB> when I manage to stabilize the API and implement the remaining
DB> features.
DB> What do you think? Do you have any suggestions or ideas?
DB> Best regards, Dani Biró
More information about the GiNaC-list
mailing list