Praveen Bharadhwaj on Fri, 25 Dec 2020 05:52:45 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Customizing the Online PARI/GP with Interactive GUI


I got it running on a test server and I'm now working on customizing it.

I located the function myevalm that takes a string input like "sqrt(2)" and evaluates it to an output string.
I am wondering if there are other ways to request numeric data (like arrays) from the PARI engine. For example, myevalm is calling Module.ccall -- maybe this would be more versatile in terms of different data formats and options?

It would be great if there is some documentation on the JS API.

Thanks,
Praveen


On Thu, 24 Dec 2020 at 17:20, Bill Allombert <Bill.Allombert@math.u-bordeaux.fr> wrote:
On Thu, Dec 24, 2020 at 01:28:46PM +0530, Praveen Bharadhwaj wrote:
> Hi,
>
> I have been trying out the online (in-browser) version. I'm now
> thinking that this could be the basis for developing interactive math
> demonstrations containing GUI elements like sliders, input boxes etc.
>
> Apparently, everything is done in the browser, because once we load
> the page, it works even if we disconnect from the internet. (However,
> saving the file to disk does not work).

Yes, this is the advantage of asm.js/wasm, there is no need
for server-side resources.

> I'm trying to reverse-engineer the _javascript_ for this purpose, but I
> thought someone on the dev team may be able to provide me with the
> information I need. For example, the page is downloading a file called
> pari-gp.js.mem  -- what is going on there?

Theses files are generated from the PARI and GMP C source code using the
emscripten compiler. I can explain you how to do that if you want.

emscripten generates two files, a .js file and a .js.mem binary file.
In assembly parlance, .js is the code section, the .js.mem is the data
section.

> ****************************
> More importantly, would the PARI team mind if someone hosted math
> demos on their web page using the PARI _javascript_ resources?
> ***************************

You are quite welcome to do it!
However, please host a copy of gp.js and gp.js.mem on your own
web server if you can.

Cheers,
Bill.