[plt-scheme] huge executables

From: Буланов Иван Сергеевич (l00bis at mail.ru)
Date: Sun Mar 19 07:32:58 EST 2006

Hello, guys!
I am moving from C++ to PLT Scheme now and it seems to me that programming in Scheme is a kind of pure pleasure. But what about programming of real-world applications?
I intended to write small shareware utils. So I have created a tiny test program to estimate it`s size.
Here is the source:

(module little-program
  mzscheme
  (require (lib "mred.ss" "mred")
           (lib "class.ss"))
  
  (define frame (new frame%
                     (label "Little program")
                     (style '(no-resize-border))))
  
  (define text-field (new text-field%
                          (label #f)
                          (parent frame)
                          (init-value "0")))
  
  (define horizontal-pane (new horizontal-pane%
                               (parent frame)))
  
  (new button%
       (label "Put a message")
       (parent horizontal-pane)
       (callback (lambda (b e)
                   (display "Here is a message")
                   (newline))))
  
  (new button%
       (label "Toggle <<enabled?>>")
       (parent horizontal-pane)
       (callback (lambda (b e)
                   (send text-field enable (not (send text-field is-enabled?))))))
  
  (send frame show #t))

;(require little-program)

I have plt-299.400-bin-i386-win32 installed on my WinXP system with MSVC 2003 compiler.
When compiled with "gmzc --gui-exe little-program.exe little-program.scm" it produces executable of 2.5Mbytes.
UPX executables packer hadn`t manage in packing of little-program.exe. Just can`t do it.
And then when compiled with "gmzc -c little-program.scm" gmzc produced a c-source of just ~30Kbytes.

Thus, is it possible to link to standard Scheme libraries statically without including of huge amount of byte-code?
Is it possible to link to native-code-compiled libraries?
Or is there any way of restricting compiler`s include path to only those modules, that are realy needed?

P.S. I thank creators of the PLT Scheme for discovering of amazing world of Scheme for me.

With best regards, Ivan Boulanov.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20060319/357e0ea2/attachment.html>

Posted on the users mailing list.