From feeley@iro.umontreal.ca Fri Jan 31 11:42:20 2020 From: Marc Feeley To: gambit-list@iro.umontreal.ca Subject: [gambit-list] Emscripten compiled Gambit in the browser Date: Fri, 31 Jan 2020 11:42:14 -0500 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1779035149923342104==" --===============1779035149923342104== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To test Gambit=E2=80=99s portability I have built the latest Gambit with Emsc= ripten to run it in the browser. To try it out visit this URL: http://gambitscheme.org/emscripten-gambit.html The system supports many features, including Gambit=E2=80=99s R7RS module sys= tem. It comes with a preloaded virtual filesystem. The REPL supports the sa= me features as on the desktop, including emacs keybindings, parenthesis match= ing, tab completion, and the REPL history is preserved from one execution to = the next (in the browser=E2=80=99s local storage). To ease experimentation, you can execute JavaScript code with the jseval proc= edure: > (jseval "prompt('please enter your name')") "spiderman" > (current-directory) "/home/web_user/" > (directory-files) ("fib.sld" "demo.scm") > (load "demo.scm") (time (fib 25)) 0.494000 secs real time 0.000000 secs cpu time (0.000000 user, 0.000000 system) no collections 7788120 bytes allocated no minor faults no major faults "/home/web_user/demo.scm" Embedding the Gambit REPL in a web page is as simple as including the file em= scripten-gambit.js in the web page, and putting emscripten_gambit.wasm on the= server with the .js file: Emscripten compiled Gambit in the browser The script for building Gambit with emscripten is in misc/build-emscripten-ga= mbit.tgz Have fun! Marc --===============1779035149923342104==--