Kayac command-line options

To compile a kaya source file, do kayac <filename> [options]. Any module dependencies in the same folder will automatically be compiled if necessary provided that a module 'Foo' has the filename 'Foo.k'.

Important options

A full list of kayac command-line options can be found on the kayac man page, but the most important ones are:

-force

Forces the recompilation of all dependencies even if they haven't changed. This is useful for recompiling source code to a new version of Kaya.

-nochase

Recompiles the specified file without doing any dependency chasing. This is sometimes useful to save time where you have made changes to a module that do not change the exported function prototypes, but only their internal workings, or if you do not want to pick up an updated dependency. Using this option improperly can cause the compilation to fail.

-nortchecks

Disables most of the run-time checking. This gives a significant speed improvement at the cost of coding errors potentially being more severe, and debugging being much harder. It also allows (although doesn't automatically enable except in webapps and CGI) incremental garbage collection, which reduces memory consumption and can make interactive applications run more smoothly.

-deprfail

Fail to compile a module or program if it uses functions (either internally or from another module) that are marked as deprecated. This is useful for smoothly upgrading code to work with later Kaya versions.

-static

Compile and link the program statically, which may be useful for distribution of pre-compiled binaries. You may get warnings from the linker when using this option as not all libraries can be statically linked without problems or limitations.

-htmldocs

Produces basic HTML documentation for the public interface of a module. Generally it is better to use -xmldocs and the HTML generation functions in the KayaDoc module. This option will be removed in Kaya 0.3.0

-xmldocs

Produces XML documentation for the public interface of a module.

-profile

Compiles the program with profiling enabled. You can then use gprof or another profiler to check for bottlenecks. You should probably recompile Kaya itself with profiling enabled to use this option (./configure --enable-profile), and you will need to use a version of libgc that has been compiled with profiling enabled to get a meaningful call graph. This option automatically turns on -static in Kaya 0.2.6 onwards.

kaya@kayalang.org | Last modified 4 September 2008 | Supported by Durham CompSoc | Powered by Kaya