[gambit-list] javascript backend

REPLeffect repleffect at gmail.com
Mon Jun 30 17:04:22 EDT 2014


I decided to play around with the javascript backend to see if I might
want to try using it for some web-based programming.

So I just compiled this little do-nothing-important program to get started:

cat > test.scm

(define (do-test a b)
  (+ a b))

(define x (do-test 1 3))
(define y (do-test 4 3))

^D

I ran gsc -c -target js test.scm, and then loaded the output
javascript file into a page on Firefox (with firebug loaded to
interact with it).

After loading the page, I get this error:

ReferenceError: Gambit_bb1__2b_ is not defined

The code in the offending generated javascript is:

if (Gambit_glo['+'] === (Gambit_bb1__2b_)) {  ...

Seems obvious to me that the '+' procedure is never defined.  So I
guess my questions are:

1) what procedures are available to me when generating javascript?

2) am I missing something obvious that would make gsc generate
everything this simple program needs

Thanks for any help you can give.



More information about the Gambit-list mailing list