[gambit-list] Re: How to create small standalone executable with Gambit-C?

peter lo peter19852001 at yahoo.com.hk
Mon Aug 17 06:26:29 EDT 2009


Dear Adrien Piérard,
Thanks for the reply. I understand that the dynamic features of Scheme makes it difficult to leave out some of the functions. What if the user is willing to sacrifice some dynamic features (such as eval)? Is there any plan in such a direction?
Suppose we divide all of the functions of Gambit-C Scheme into different modules, possibly with hierarchies. Then for a particular program, if certain functions are not used, the whole module need not be linked. In this way, we can add many libraries to Scheme without worrying inflating standalone executable unnecessarily.

Regards,
Peter





----- 郵件原件 ----
寄件人﹕ Adrien Piérard <pierarda at iro.umontreal.ca>
收件人 peter lo <peter19852001 at yahoo.com.hk>
副本(CC) gambit-list at iro.umontreal.ca
傳送日期﹕ 2009 年 8月 17 日 星期一 下午 1:59:04
主題: Re: [gambit-list] How to create small standalone executable with  Gambit-C?

2009/8/17 peter lo <peter19852001 at yahoo.com.hk>:
> Dear all,
>    I am new to Gambit-C. I keep hearing that with Gambit-C, it is easy to create small executable. But when I tried, a simple hello world program takes around 3 MB when compiled as a STANDALONE executable. Is there a way to create small executable which includes only used functions, just like in C, we don't link the whole library into the executable.
> Thanks.
> Peter

Hi Peter.

This is quite hard, because in Scheme, you may call a function which
does not appear in the source code.
For example, the code below uses the function "LOAD", but there is no
way you can forsee that…
This is not a problem of Gambit-C, it's a feature of Scheme (and other
languages with an EVAL function)

(define func "lo")
(define tion "ad")
(eval (list (string->symbol (string-append func tion)) "another-file.scm"))

P!

-- 
Français, English, 日本語, 한국어



      Yahoo!香港提供網上安全攻略,教你如何防範黑客! 請前往 http://hk.promo.yahoo.com/security/ 了解更多!



More information about the Gambit-list mailing list