[gambit-list] How can built a small as 5 Kbytes "Hello World" program ?

Ryuho Yokoyama ryuho8 at ybb.ne.jp
Mon Jan 19 01:28:19 EST 2015


Thank you very much for replying.

I downloaded the "gambc-v4_7_3.gz", then

$ ./configure --enable-single-host --enable-shared
$ make

I could get a "libgambc.dll" now.

>type h.scm
(display "Hello ")
>type w.scm
(display "World")
>gsc -link h w
>gsc -obj h.c w.c w_.c
>gcc  -o w.exe h.o w.o w_.o libgambc.dll -lws2_32
>w.exe
Hello World
>

This time the size of the "w.exe" is 136KB.  It's very small.

Thank you very much again for your help.

-----Original Message----- 
From: Marc Feeley
Sent: Monday, January 19, 2015 1:51 PM
To: Ryuho Yokoyama
Cc: gambit-list at iro.umontreal.ca
Subject: Re: [gambit-list] How can built a small as 5 Kbytes "Hello World" 
program ?

You need to configure Gambit using --enable-shared, i.e.

  ./configure --enable-single-host --enable-shared
  make

This will build a DLL for the Gambit runtime library, so that the .exe doesn窶冲 contain the runtime library.

Marc

> On Jan 18, 2015, at 9:54 PM, Ryuho Yokoyama <ryuho8 at ybb.ne.jp> wrote:
>
> I built a "Hello World" program as follows,
>
> >type h.scm
> (display "Hello ")
> >type w.scm
> (display "World")
> >gsc -link h w
> >gsc -obj h.c w.c w_.c
> >gcc -o w.exe h.o w.o w_.o 
> >C:/Gambit-C_64bit/v4.7.3/lib/libgambc.a -lws2_32
> >w.exe
> Hello World
> >
>
> This way, the size of the "w.exe" is 4.61MB.
>
> In Gambit-C manual documents
> 3. The Gambit Scheme compiler
>   3.4 Link files
>      ... A "Hello World" program built this way can be as small as 5 
> Kbytes. ...
>
> Could you please teach me how to built program as small as 5 Kbytes one.
>
> Thanks in advance.
>
>
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list




More information about the Gambit-list mailing list