[gambit-list] Information about the Gambit-C Javascript Backend
Paulo Silva Filho
paulosfilho at gmail.com
Fri Jul 19 14:23:42 EDT 2019
Sires,
I've realized that the examples seemed to be built using a development
version of Gambit-C. I tried on a very stable version (4.6.6), which is
from six years ago, and I've tried from a more recent version, 4.9.3, from
the default package installers, in Windows and Linux.
I've looked for the some hints about which version of Gambit is being used
on all examples, and the features and files shown (like _univlib.scm,
present in the development version of Gambit - directly from Git, on
https://github.com/gambit/gambit/blob/master/lib/_univlib.scm) and I
realized that the compiler version used need to be an experimental one.
So I'll try all the samples, again, but from a version of gambit compiled
directly from the source code, downloaded from the main repository.
Thank you from all answers. I'll keep you in touch.
Em sex, 19 de jul de 2019 às 12:37, Marc Feeley <feeley at iro.umontreal.ca>
escreveu:
> Like so:
>
> % cd gambit
> % cd lib
> % make _gambit.js
> ../gsc/gsc -:~~bin=../bin,~~lib=../lib,~~include=../include -f -target js
> -prelude
> "(define-cond-expand-feature|enable-type-checking|)(define-cond-expand-feature|disable-auto-forcing|)(define-cond-expand-feature|enable-sharp-dot|)(define-cond-expand-feature|enable-bignum|)(define-cond-expand-feature|enable-ratnum|)(define-cond-expand-feature|enable-cpxnum|)(define-cond-expand-feature|disable-smp|)(##include\"../lib/header.scm\")"
> -o _gambit.js ../lib/_univlib.scm
> % cd ..
> % gsc/gsc -:=. -target js -exe app.scm
> % ./app
> 1
> 256
> 65536
> 16777216
> 4294967296
> 1099511627776
> 281474976710656
> 72057594037927936
> 18446744073709551616
> 4722366482869645213696
> 1208925819614629174706176
> 309485009821345068724781056
> 79228162514264337593543950336
> 20282409603651670423947251286016
> 5192296858534827628530496329220096
> 1329227995784915872903807060280344576
> 340282366920938463463374607431768211456
> 87112285931760246646623899502532662132736
> 22300745198530623141535718272648361505980416
> 5708990770823839524233143877797980545530986496
> % cat app.scm
> (define n 20)
> (for-each (lambda (i)
> (println (object->string (expt 2 (* i 8)))))
> (iota n))
> (exit)
>
> This should work for the other backends too. Note that there’s some bit
> rot of lib/univlib.scm, so there are issues with some parts of the Gambit
> library (for example write and pretty-print are broken, (exit) is needed to
> avoid an exception on exit, etc). You can revert to previous recent
> releases of Gambit to get these working correctly.
>
> Sorry but lots of things are in flux right now…
>
> Marc
>
>
>
> > On Jul 19, 2019, at 11:08 AM, Amirouche Boubekki <
> amirouche.boubekki at gmail.com> wrote:
> >
> > Sorry for the multiple emails!
> >
> > Le ven. 19 juil. 2019 à 13:38, Marc Feeley <feeley at iro.umontreal.ca> a
> écrit :
> > You should look at this recent thread:
> https://mailman.iro.umontreal.ca/pipermail/gambit-list/2019-July/009103.html
> >
> > In the above mail thread, it is described how to compile a scheme file
> into javascript WITHOUT "Gambit runtime".
> >
> > Q: How can I bundle the Gambit runtime into the compiled JavaScript file?
> >
> >
> > Thanks in advance!
>
>
>
--
Paulo Silva Filho
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20190719/f814e971/attachment.htm>
More information about the Gambit-list
mailing list