[gambit-list] -target js

Francois Magnan magnan at categoricaldesign.com
Wed Nov 13 23:08:22 EST 2013


Hi Marc,

Yes it works much better. Now I just need to implement some library functions in javascript.
For example I get:

TypeError: ‘undefined’ is not a function (evaluating 'Gambit_glo['with-output-to-string']()')

I will tweak my Scheme code to avoid those abstractions for the moment.

Thank you,
Francois


On 2013-11-13, at 16:20, Marc Feeley <feeley at iro.umontreal.ca> wrote:

> 
> On Nov 12, 2013, at 1:13 PM, Marc Feeley <feeley at iro.umontreal.ca> wrote:
> 
>> 
>> On Nov 12, 2013, at 12:39 PM, Francois Magnan <magnan at categoricaldesign.com> wrote:
>> 
>>> Hi,
>>> 
>>> I would like to use the -target js mode of Gambit to compile a scheme program and run in in a browser. I read on this list that the functionality is still incomplete but I wonder if there are plans to make it work in the near future.  
>>> 
>>> I was able to compile trivial programs but my first try at a “real life” example is failing. It seems the generated javascript is missing some library functions like that the generated code is calling like:
>>> 
>>> Gambit_Symbol.stringToSymbol()
>>> Gambit_Char.fxToChar()
>>> Gambit_String.jsstringToString()
>>>>>> 
>>> Is there a more complete version somewhere that defines those gambit structures in javascript?
>>> I used Gambit-4.7.0 for my tests.
>> 
>> Could you try with the most recent version on the Gambit repo?  The JS backend is not complete, but it has progressed substantially about a month ago.  My plan is for the JS backend to be sufficiently complete to compile the standard Gambit runtime system.  Because it is not there yet, currently, you have to write your own versions of some of the standard runtime library functions (append, member, etc).
>> 
>> Marc
> 
> Actually, I should have asked if you did a "make from-scratch" (which is the new way to bootstrap Gambit from the github repo).  So you should be doing:
> 
> % git clone https://github.com/feeley/gambit.git
> % make -j8 from-scratch
> 
> Once this is done, you will have a current Gambit to test things out with.
> 
> Marc
> 




More information about the Gambit-list mailing list