[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reducing lisp programs' size



In article <dlamkins-2403952131450001@ip-pdx6-02.teleport.com>,
dlamkins@teleport.com (David B. Lamkins) wrote:

> If this is (was) Procyon Common Lisp, it doesn't really have a tree shaker
> -- you have to *manually* (yes, by trial and error) specify which packages
> to eliminate from the image for a standalone application.  The salesperson
> I talked to at Franz said that a lot of their customers "had difficulties
> using the application generator."  I have yet to deal with it for a
> production release, but I don't relish the thought of having to figure out
> all of the dependencies by myself.  *That* is what a tree shaker is
> supposed to do.

The documentation for save-application is sort of unclear in ACL/WINDOWS
but the following worked well for us:.

This seems to work as a restricted tree-shaker, our delivery image is way
smaller than our development image. The compiler is really removed not
only disabled as in MCL.

Karsten


(acl::create-standalone-application
 'user::d3-top-level
 ; :image-part-size 1400
 :package-directives
 '(
   (:common-lisp-user .  :keep)
   (:common-lisp . :external)
   
   ;for security
   (:system . :external)
   (:Allegro . :external)
   (:COMTAB . :external)
   (:PC . :external)
   (:c-types . :external)
   (:WINDOWS  . :external)
   (:TEXT-EDIT  . :external)
   (:PRINTER . :external)
   (:COMMON-GRAPHICS . :external)
   (:KEYWORD  . :external)
   )
 )

and user::d3-top-level = 

(defun d3-top-level ()
  (d3-prepare-windows)
  (let ((*standard-output* *d3-message-window*)
        (*TERMINAL-IO* *d3-message-window* )
        (*error-output* *d3-message-window*)
        (*error-hook* 'our-error-handler)
        (*lisp-main-window* *d3-main-window*)
        )
    (catch :error
      (catch :cancel
        (catch 'pc::default-cancel
          (select-window *d3-main-window*)
          (d3-initialize)
          )))
    ;main loop
    (loop
      (catch :error
        (progn
          (when (closed-stream-p *d3-main-window*)
            (return :beendet))
          (catch :cancel
            (catch 'PC::DEFAULT-CANCEL
              (process-pending-events)
              )))))))

 Karsten A. Poeck, Lehrstuhl fuer Informatik VI, Universitaet Wuerzburg
 Allesgrundweg 12, 97218 Gerbrunn, Germany
 E-mail: poeck@informatik.uni-wuerzburg.de
 Tel ++ 49  931 70561 18, Fax ++ 49 931 70561 20
 http://wi6a76.informatik.uni-wuerzburg.de/HTMLs/ls6-info/Assis/poeck/poeck.html