home of the Kew programming language

Roadmap for release 0.2.X

It's been over a year since Kew 0.1.4 was released, and I've spent a lot of time working on some of the most fundamental ideas in the language. The next release will mark some significant shifts in the way Kew works with a view to making it usable to developers - at least ones who don't mind a none-too-well-polished language.

My idea is to make much smaller releases in the 0.2.X series. Each release will aim to add one or perhaps two features, and those features will be in Kew's standard library. There are no major plans to change Kew's syntax during this release series. The only likely candidate for that is the @ feature for computing message selectors.

Syntax changes

There are already a number of syntax changes intended to make Kew slightly easier to learn. Strings are now represented using "double quotes". Comments are now based on the Ada syntax (you never thought I'd borrow from Ada, did you?!) of double dashes and continuing to the end of the line. As before, comments are attached to particular language features, such as argument names.

"a string"
-- a comment

Lists of arguments and results

Multiple arguments and results are also supported, and in a way that is very efficient. You can now collect any number of arguments to a block using a single declared argument using the ... syntax. For example, :A... will be bound to a list of however many arguments were supplied. This works for returned results as well. And you can expand a list into separate arguments when making a call. Kew does not expand or contract these lists unnecessarily.

[:SingleArg :MultipleArg... :AnotherSingleArg
Object doStuff OneArg MyListOfArgs... MoreArgs...
Object doStuff :Result1 :MoreResults... :ResultN

Message reflection

I hope to support reflective message sending and receiving, although doing so efficiently is proving to be a bit of a conundrum. I hope it will look something like this:

"Message" :A.
Object @("complete", A) -- will invoke method 'completeMessage'

  @MessageSelector [:Args... -- will accept any message and
  bind the selector to 'MessageSelector'

Self-references have changed: an object still refers to itself as 'Self' by default, but you bind a new name for it using : as you do for all other names:

  aMethod [ThisIsMyName otherMethod]
  otherMethod [

Partial objects

Objects can now be in a partially-constructed state and still be used. This is useful mainly to set up graphs of objects which have circular references without having to have 'setMyBackReference' methods. During construction of an object you can run any code you like, which can refer to the partial object's reference, but is not allowed to send it any messages (it is an exception to do so). After the object is completed messages can be sent as normal. This looks like:

  [ -- this runs code which accesses PartiallyCompletedObject
    [PartiallyCompletedObject doStuff] :CrossReferenceBlock.
  method [CrossReferenceBlock call]

The bit in [ ] just inside the object definition is the new bit.

Garbage collection

Previously, Kew relied on programs stopping before they ran out of memory, because it did not collect garbage. I always planned to add this, and it's included in 0.2.X. I've chosen not to use my own garbage collector in favour of Hans-J Boehm's "GC" conservative collector as this leads to a simpler C API for extending Kew.


Kew now supports infinite precision numbers courtesy of the GMP library. In future it may support infinite precision floats as well.

Unicode strings

Strings will move to a Unicode encoding during 0.2.X.

Sandbox security

Kew supports proper sandboxes which can be used to create safe operating environments for code to run with restricted permissions.

See security model.

Secure services

Working hand in hand with the sandbox you can restrict system services to allow only certain kinds of access - effectively providing custom services that only allow components limited permission. To do that, you can define...

Custom containers

Containers can now be created whenever you wish. They are very lightweight and consist only of a set of services (i.e. objects with names that are provided to loaded components) protected with a sandbox.


0.2.X will offer a reflection model that allows you to define object types and create instances reflectively.

Activation model

Kew now offers an activation model that allows components of any type to be activated. A registry maintains mappings from component MIME type to activator, and this can be extended. One practical consequence is that you can use images, text and other file types just like normal objects - no need to mess around with reading them in as resources and using a library to parse them.

Another nice consequence is that Kew now naturally supports components in different formats, one of which is....

Bitcode components

Bitcode is Kew's variant of bytecode, a very very compact system for encoding compiled components. Because Kew has so few primitive operations, it is possible to use an extremely compact encoding that should be great for small-memory systems and fast downloads.

Kew can support a mix of bitcode, native code and Kew sourcecode components.

Packaging model

Kew now has a well defined packaging model that allows you to create packages of components in a tree structure for easy editing and deployment. The package system works with the container system to allow you to create containers that make new services from components in the package and then activate components nested deeper in the package structure. So, you can package your application along with your application server...


After some mildly successful Mozilla programming last year, I decided to add relational support to Kew in 0.2.X. This is an additional state-storage mechanism to variables, and allow you to maintain forward and backward single/multiple references easily - just like run-of-the-mill relational relations really. In fact they are most like RDF relations.


Kew doesn't support delegation as a syntax feature, but does provide an object that allows delegate chains to be constructed and used.

Flyweight objects

Kew allows objects to be created and destroyed on demand. A flyweight manager can create objects whenever they are first sent messages, and delete them (without affecting any of the references to them) whenever desired. Huge collections of very large objects can seem to exist using this mechanism - ideal for persistence layers.


Any object can support observers. Just say: Observers of MySubject add MyObserver.

Copyright 2004 Duncan Pierce, hosted by Logo