Application development can be considerably eased by splitting the application in a large number of orthogonal and reusable functors. However, deployment of an application gets harder in the presence of a large number of functors:
Installing the application requires correct installation of a large number of functors.
Execution might be slow due to frequent file- or even network accesses.
The commandline tool ozl eases deployment by creating a new functor that includes imported functors in a prelinked fashion: it is possible to collapse a collection of functors into a single equivalent one. The model that should be kept in mind, is that the newly created functor employs an internal, private module manager that executes the toplevel application functor together with all included functors.
The linker can be invoked on the input functor
In in order to create an output functor
Out as follows:
For example, from the pickled toplevel functor
LMF.ozf a new functor can be created as follows:
ozl LMF.ozf -o LMF.oza
where the pickled functor
LMF.ozf is created by compilation as follows:
ozc -c LMF.oz -o LMF.ozf
Now the newly created pickled functor
LMF.oza can be installed everywhere, the functors stored in
Form.ozf are included in
The linker can be used in verbose mode with the option
-v as abbreviation). In verbose mode the linker prints information on which functors are included and which functors are imported by the newly created functor. For example,
ozl -v LMF.ozf -o LMF.oza
prints something like
The linker also supports options that control which functors are included, for more information see Chapter 3 of ``Oz Shell Utilities''.
Pickles created by the compiler and linker can also take advantage of compression. For that matter, both tools support the
-z as shortcut) option that must be followed by a single digit that defines the compression level to be used.
For example, the pickled functor
LMF.oza can be created compressed by
ozl --compress 9 LMF.ozf -o LMF.oza
This reduces the used disk space by 50%.
This section shows a convenient form to execute functors.
-x as shortcut) can be supplied to both compiler and linker. Functors that are created with that option can be directly executed. For example, the file
lmf.exe created with
ozl -x LMF.ozf -o lmf.exe
can be directly executed:
The pickled functor
lmf.exe just features a particular header that allows direct execution. It can still be used together with the
Naturally, the extension
.exe can be omitted under Unix.