Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
| Download

Testing latest pari + WASM + node.js... and it works?! Wow.

Path: pari / run / pari.js
Views: 1556
License: GPL3
Image: ubuntu2004
1
/*
2
~/pari/run$ node
3
Welcome to Node.js v14.15.5.
4
Type ".help" for more information.
5
> (async ()=>global.pari = await require('./pari')())()
6
Promise { <pending> }
7
> pari('2+3')
8
'%1 = 5\n'
9
*/
10
11
module.exports = async (size = 536608768) => {
12
const module = await require("./gp-sta")({ noInitialRun: true });
13
module.ccall("gp_embedded_init", null, ["number", "number"], [size, size]);
14
return (s) => module.ccall("gp_embedded", "string", ["string"], [s]);
15
};
16
17