This page introduces some of the major features of Kaya, with examples of code and additional explanation on the pages linked to. See the language tutorials for explanations of any syntax that isn't clear at first glance.
Kaya is available for Linux, Mac OS X and Windows, and should work on any other POSIX-compliant system. Programs written in Kaya can be compiled on any of these operating systems, and can run on a wide variety of hardware architectures - see the instructions for compiling Kaya for a full list.
Powerful and unobtrusive type system
Kaya's powerful type system makes it easy to meaningfully represent complex data structures in your program, allowing many bugs to be found at compile time. Type inference means that the need to explicitly write types down is minimised, while polymorphic records and functions, together with ad-hoc function overloading, allow easy writing of general functions.
There are several primitive types, including automatically-sized multi-dimensional arrays, and the standard library defines many useful types for processing user input, HTML and XML web development, database access, and more.
Kaya includes extensive pattern matching capabilities, allowing analysis of complex data structures and extraction of needed variables to be expressed more readably than via a sequence of nested if statements.
Complex data types may be aliased to type synonyms, to improve the readability of code, and to allow for implementation changes.
Built-in web development libraries
The Kaya standard library includes many features for web developers, including easy state management between pages, a code development model ensuring high-quality cross-browser HTML, and single-function access to commonly-needed features such as refilling forms. Security is today a major concern on the web, and Kaya's web development model allows you to easily minimise the risks of cross-site scripting, remote code execution, SQL injection and other common web vulnerabilities.
As Kaya can be easily used for web applications and stand-alone programs, it is straightforward to share data access functions and other common methods between your front end web application, and back-end maintenance scripts, or to develop an offline preprocessor to generate your static pages in the same style as your dynamic web applications.
Partial function application and anonymous functions
Kaya allows functions to be partially applied, with the remaining parameters completed later. This allows easy development of generalised functions, evaluation of expensive functions to be postponed until necessary, and separation of program code into logical chunks to be done without sacrificing efficiency.
Anonymous (lambda) functions can also be constructed.
Large range of standard library functions
Kaya has a large standard library containing modules for database access with a cross-database API, image generation with libgd, regular expressions and much more, including the web development libraries mentioned above. API documentation is available on this website and in Unix 'man' page format with the distribution.
Other features include:
- Automatic garbage collection via libgc
- Foreign functions interface to call C libraries
- Exception handling
- A module system
- Usable as a scripting language with '#!' line
Kaya is in active development, and suggestions for features are welcomed. Language design and implementation will always be driven by users' requirements, rather than what seems cool or fashionable in other languages. Check the current plans for development and give your suggestions on the mailing list if you think we're missing something important.