[gambit-list] Questions & documentation on the universal backend

Jon Woodring woodring.jon at gmail.com
Sun Aug 14 00:23:57 EDT 2016


Is there any documentation on compiling to javascript, or is it mostly in
the mailing list archives? After some scrounging, I was finally able to
figure out how to compile and get a simple (println (fib 5)) working:

$ cd gambit/lib
$ gsc -:~~bin=../bin,~~lib=../lib,~~include=../include -f -target js
-prelude "(##include \"header.scm\")" -o _gambit.js ../lib/_univlib.scm

$ gsc -warnings -target js code.scm
$ gsc -warnings -link -l _gambit.js code.js
$ cat code_.js _gambit.js code.js > p.js
$ node p.js

1) Is that mostly correct? I take it it is still a WIP because I couldn't
find documentation.

2) What if I want to use the Python backend? I tried swapping in all of the
targets with -target python but then get this error:
$ python2 p.py
Traceback (most recent call last):
  File "p.py", line 26310, in <module>
    g_bb1_serial_2d_number_2d__3e_object.name = g_cst1727___gambit
NameError: global name 'g_cst1727___gambit' is not defined

3) Is there a concise example of #inline-host-expression (-statement &
-declaration) to be able to have scheme call javascript and vice versa?
Same with python? I'm not sure what is correct from my reading of the
mailing archive.

Thanks,
-Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20160814/33059449/attachment.htm>


More information about the Gambit-list mailing list