I recently was able to get a hold of a build of Donal Fellow’s Object-Oriented Programming extension for Tcl, familiarly known as “TIP 257“. I helped come up with the spec for TIP 257 last year, but just as no battle plan survives first contact with the enemy, so no software design spec survives implementation unchanged. Consequently I’ve been spending the last few days getting familiar with the revised spec.
The primary goal of TIP 257 is to provide a fast, minimal OOP implementation for the Tcl language which can be used directly and which can also serve as a foundation for significantly less minimal frameworks. One of those less minimal frameworks is my own Snit package, which is available as part of Tcllib. Currently, Snit is doesn’t depend on TIP 257; there are two reasons for making it do so, speed and functionality. Snit is highly optimized, but there are some things that are just slow. TIP 257 does considerably more in C, and consequently should be faster at these things. Second, as object systems go Snit provides the bare bones; for example, it doesn’t allow inheritance (which would be seriously nice to have on occasion). Snit-on-257 might really be Snit-on-steroids.
Now, I’m confident that I can build a Snit-workalike on top of Donal’s API (after all, I can build it without Donal’s API). But there are a number of questions whose answers I need to discover. What compromises and workarounds am I going to have to make to duplicate Snit’s precise syntax and semantics? If I end up with something that has no additional speed and no additional features, there’s no point in it. If I aim at something Snit-like but not precisely identical, can I do significantly better? Are there holes in 257 where a little more functionality would be a really big help? Are there aspects of 257 that cause me serious problems?
To answer these questions, I’m embarking on a project called iGloo, a name I came up with a couple of years ago when Snit was gaining in popularity and I had begun to wish I’d called it something else. If I decide that it’s worth doing a perfect clone of Snit on top of 257, iGloo might just be a research project. If I decide that perfect compatibility with Snit is too constraining, iGloo might go on to be Snit’s replacement. Either way, it should be fun.
I wonder if you could marry Snit’s delegation model with Traits and get you not only the inheritance you want or need but a very clean way to do it. Just a though.
LikeLike
I’m not familiar with Traits; can you tell me more about them?
LikeLike
Hi,
I would like to tell you that I have been investigating into emulating Snit with others OO systems. (yes, really!)
Xoins (http://wiki.tcl.tk/xoins) is Snit under XOTcl and thus, could be adapted to TIP#257. It has never reached full compat. but is functionnal for simple feature. If you dare, you can take ideas from it, it is free software.
As the author of Xoins, I abandonned this project because compatibility with Snit under XOTcl is *tough*.
I hope you will success in your project. Good luck!
LikeLike
Googling for “object traits” eventually led me to this: http://www.iam.unibe.ch/~scg/Research/Traits/
For some object systems, you can compose some aspects of object behavior by using a sort of bundle of methods. I suppose they would be like “mixins” but with known groups of methods.
LikeLike