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

stand-alone executables in v200



mzc's --exe and --gui-exe modes now work in the v200-taged code.

Unlike the flags for version 103.X, the flags in v200 work only with
programs based on `module'. One benefit of this restriction is that the
set of modules needed to execute the main module can be determined
automatically.

For example, given the following code in b.ss:

  (module b mzscheme
    (require (lib "class.ss")
	     (lib "mred.ss" "mred")
	     (lib "browser.ss" "browser"))

    (define f (instantiate frame% ("My Frame" #f 400 300)))
    (define browser (instantiate hyper-panel% (#f f)))
    (send f show #t)

    (send (send browser get-canvas)
	  goto-url
	  ;; The starting URL:
	  "http://www.htdp.org/";
	  ;; #f means not a relative URL:
	  #f))

Then

  mzc --gui-exe browser.exe b.ss

creates a simple web browser as a (large) stand-alone executable named
"browser.exe". The programmer does not have to know that various parts
of the browser implementation are drawn from the "browser", "net",
"mzlib", "syntax", and "mred" collections.

Library modules that are referenced dynamically --- through `eval',
`load', `dynamic-require', etc. --- are not automatically embedded into
the created executable, but they can be explicitly included using mzc's
++lib flag.

The "embed.ss" library of the "compiler" collection provides a more
general interface that can handle non-`module' code, but it makes no
attempt to auto-embed the modules that are required by top-level code.

Matthew