About the Kaya programming language

Kaya 0.2.5 released on 20 April. Download the latest source now. This version contains many improvements and bugfixes, so all users are recommended to upgrade.

What is Kaya?

Kaya is a compiled scripting language, distributed for free under the GNU GPL. It is statically typed, meaning that the compiler will help you by checking for consistent variable usage and reporting errors before you run your program. It also uses type inference, meaning that the types of variables are worked out by the compiler, so there is no need for you to declare local variables, or use type casts.

Kaya development is supported by Durham University Computing Society. For release announcements, discussion of development, help with Kaya programming or installation, and more, join the mailing list to see what we’re up to.

Why should I use it?

Kaya is useful for small but slightly complex scripting tasks and small to medium scale web applications; the type system makes it simple to represent complex data structures (e.g. records, results of database queries, directory trees…) with very little code.

Static typing catches a large class of common errors at compile time (e.g. referring to the wrong part of a data structure), while type inference removes many of the overheads commonly associated with strong static typing (e.g. having to declare local variables).

Kaya includes support for “tagged union” data structures, a powerful feature more commonly found in functional languages such as Ocaml and Haskell.

Kaya also has built-in abstractions for web application development, making it easy to write a CGI program without paying too much attention to low level details such as state management and form handling. The language design also ensures high quality HTML output and removes many possibilities for common web application security vulnerabilities.

The Kaya distribution includes several libraries for database access, networking, image manipulation, cryptography, system interaction, data manipulation, web application development, and more.

Kaya has been designed and implemented to solve real, practical problems, for which we’ve found other languages to be not quite satisfactory – you won’t find any exciting research into type systems or language features here! Instead, you’ll find various features that we’ve found useful in other languages and brought together here.

Of course, no language is good for every task. You might prefer not to use Kaya if you are writing simple batch scripts where the data is no more complicated than strings and lists (at one extreme) or if you are writing large scale distributed systems (at the other extreme).

What are Kaya’s features?

Kaya has the following features (in version 0.2.5, released 30 January 2007)

  • Compiled;
  • Available for Linux, Mac OS X and Windows;
  • Type inference (no need to declare the types of local variables);
  • Garbage collection, via libgc;
  • Primitives types Bool, Char, Int, Float, String, File and Ptr (for foreign objects);
  • Native support for unicode characters;
  • Multi-dimensional, automatically sized array type;
  • Polymorphic data structures and tagged unions (algebraic data types);
  • Polymorphic record types;
  • Ad-hoc polymorphism for overloading of function names;
  • Polymorphic higher order functions;
  • Closures, partial application, anonymous functions (lambda);
  • Type synonyms;
  • Pass by reference;
  • External C function calls;
  • Exception handling;
  • Abstractions for web application development;
  • Built in symmetric key encryption;
  • A module system;
  • Usable as a scripting language with #! line

Kaya is in active development, and suggestions for features are, of course, welcome. Future versions are likely to include such features as full pattern matching and possibly type classes or subtyping. However, language design and implementation will always be driven by users’ requirements, rather than what seems cool or fashionable in other languages.

Where can I get Kaya?

Download the latest Kaya release in either source or binary form, or use DARCS to obtain the latest development snapshot.

Where can I find documentation?

This site has tutorials explaining Kaya’s syntax and features, as well as function and type documentation for the Kaya standard library

Of course, the documentation always risks being incomplete when compared to the source code itself, so please let us know where you think it needs improving.

Why is it called Kaya?

Kaya is the wood used to make traditional go boards. Since some of us play Go, and trees are tenuously related to the language in that algebraic data types describe trees, it seemed like a good name. All the best names were already gone ;).

Recent Comments

No comments to show.