Bill Allombert on Thu, 24 Dec 2020 12:31:53 +0100


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

Re: Customizing the Online PARI/GP with Interactive GUI


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.