Thanks Dima for taking the first step,
https://github.com/oldk1331/fricas0/pull/1
Making fricas0 ASDF-loadable is not that complicated,
but still needs some non-trivial changes in fricas.
Next, taking inspiration from maxima-wasm,
https://gitlab.com/spaghettisalat/maxima/-/blob/emscripten-port-deployed/wasm/build.sh
compiling fricas0 files into wasm, together with ecl,
saves the trouble of bytecode compile and loading thousands of
small files over Internet.
A proof of concept:
https://oldk1331.github.io/fricas-wasm/
Now with good Internet connection, you can have fricas loaded
with all algebra, ready to run in 11s. If you refresh with
cached files, then it only takes 3~4s.
The performance seems to be 1/3 of ECL, 1/10 of SBCL,
around 20x faster than previous wasm version.
Known problems:
1. the result wasm is 79MB, fails to be loaded in firefox,
chrome works.
2. some very nasty hacks/workarounds have to be applied,
I'll try to sort them out in the following posts.
3. the major problem is complication of algebra lisp files.
Currently in fricas, the build is in stages, and is image based.
That means some macros are already in the environment.
For asdf ans wasm compiling process, that almost requires
each and every lisp files can be compiled independently by
a vanilla ECL. My hack is almost to prepend lisp/primitives.lisp,
with eval-when.
- Qian