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'.
A full list of kayac command-line options can be found on the kayac man page, but the most important ones are:
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.
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.
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.
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.
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.
Produces XML documentation for the public interface of a module. The KayaDoc module can be used to process this XML, and the
kayadoc2man program will automatically turn it into a set of man pages.
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.