« 0.38 'Eagle' alpha screenshot | Main | A little here, a little there »

April 26, 2005

Release 0.38 (Eagle)

ConteX 0.38 'Eagle' is out, introducing object oriented programming with simple delegation, and many other small conveniences. All of the foundation is in place for a showcase of true power to come in 0.39

I started by making sure I could build java objects of any kind in CX. If you look at the first half of my unit test file for 'object construction', you'll see examples of objects being built from the java foundation. I feel no need to go into detail about how this is implemented because nothing could explain it better than reading my code.

The second half of that very same unit test file does some object oriented programming. Since this feature was just introduced into CX, it is only being tested for bare-bone sanity, nothing fancy. I will fully exploit this object oriented power in CX throughout the next release, attempting to figure out the best conveniences to add.

This barebone object oriented programming enabled in CX ultimately allows one to do anything found in, say, java's object oriented programming.

(cx:) make["myObject" new-context] (makes a new context, delegated directly to the lobby)
(cx:) inject[myObject {make["f" 4]}]
(cx:) from[myObject "f"]
4

new-context, inject, and from are the main new words in CX. new-context uses the java object creation I made earlier to create a brand new instance from the Context class . Use make or set to give the new context a name, which you will use to refer to it. Now, you can run code inside that object with inject! Using from, you may refer to any variable or call any function you may have injected into that context.

All of the fancy features to come in CX will be built off these 3 words. ConteX 0.39 'Falcon' will exploit this power to the max, attempting to acheive as many conveniences found in other prototype-based object oriented languages in regard to the OO itself. Expect constructors, user-defined types, unions, interfaces, etc.

In addition to the exploitation of object orientation in CX, Falcon aims to provide as much as needed for CX to be useable for other projects. Expect threads, method inlining, in-console help, and then, finally, some libraries that will provide easy access to foundation code like the Swing library, and java.io. The method inlining is my first whack at optimization in jcx. Though jCX is already fast enough for many applications, the method inlining should more-than double the speed. I'll consider bytecode compilation, but it may not be worth the work.

Posted by Rex at April 26, 2005 09:56 PM

Comments

Post a comment




Remember Me?