[gambit-list] Problem building univ-lib for JS

Blake McBride blake at mcbride.name
Wed Feb 11 21:54:12 EST 2015


Dear Marc,

I see what you are saying.  I compiled a small function without the library
and it was 16K.  That's fine.  I also understand what you are talking about
regarding the library.  I can pair that done.  So, the big thing is the
separate compilation.  This way, I presume, I could compile any number of
modules, compile them (somewhat) independently, and then combine them when
needed without getting a lot of duplicate code.

I gather that the tranpoline framework is required in each module.  That
should be okay.  Keeping it, and any other code that is similar across
modules minimum is important.

Thanks!

Blake


On Tue, Feb 10, 2015 at 9:16 PM, Marc Feeley <feeley at iro.umontreal.ca>
wrote:

> Separate compilation is not yet fully supported, but it is on my TODO.
>
> It takes 5 MB because all of the univ library is there (including eval,
> bignums, etc). A smart linker could bring this down a bit.  If you want a
> minimal library, write it yourself so that it only contains what you need.
>
> Marc
>
>
>
> On Feb 10, 2015, at 6:09 PM, Blake McBride <blake at mcbride.name> wrote:
>
> I updated (last update was a few days ago) and it now works.  There are
> two issues, however, as follows:
>
> 1.  The resulting JavaScript file on a two line program is 5.7 MB.  Is
> this correct?
>
> 2.  How can several scheme files be compiled independently and then linked
> (combined)?
>
> Thanks!
>
> Blake
>
>
> On Tue, Feb 10, 2015 at 11:16 AM, Marc Feeley <feeley at iro.umontreal.ca>
> wrote:
>
>>
>> > On Feb 10, 2015, at 10:30 AM, Blake McBride <blake at mcbride.name> wrote:
>> >
>> > Would really appreciate some help with this.  I'd really like to
>> document and use the system but I am stuck.
>> >
>> > Thanks.
>> >
>> > Blake
>>
>> I’m not sure what version of Gambit and univ-lib you are using, but there
>> was a change in the naming convention in the generated code.  Initially
>> “Gambit_” was used to prefix all generated names, but this did not work out
>> well for languages where an initial capital letter is used for classes.  So
>> in more recent version of Gambit, “gambit_” is used for global variables
>> and functions, and “Gambit_” is used for classes.
>>
>> So you should call gambit_js2scm(…) instead of Gambit_js2scm(…).
>>
>> Marc
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20150211/ef39dd55/attachment.htm>


More information about the Gambit-list mailing list