As part of my ongoing work on the Cloverfield project, I (FB) am pleased to announce the twelfth version of colibri.
Wiki page: https://wiki.tcl-lang.org/Cloverfield
Colibri is a string and data type infrastructure. It features:
Colibri is written in plain C and is free of any dependency besides system libraries. The compiled binary DLL on Windows is about 39kB. The source code is heavily commented and follows the Tcl quality standards.
Colibris, known in English as hummingbirds, are a family of birds known for their small size and high wing speed. The bee hummingbird (Mellisuga helenae), found in Cuba, is the smallest of all birds, with a mass of 1.8 g and a total length of about 5cm. They are renown for their stationary and backward flight abilities on par with flying insects, which allow them to feed on the nectar of plants and flowers in-flight.
I've chosen this name for this project because its goal is to be fast and lightweight, and to follow the feather and bird theme shared with Tcl and many related projects.
From the Cloverfield announcement:
So Colibri is a candidate infrastructure for Tcl9 as an alternative to the current Tcl_Obj-based core implementation. I believe that the features provided by Colibri shall yield higher levels of performances than the current architecture, at the price of an ABI incompatibility (for which major versions are made anyway), but with a similar philosophy that should ease conversion of existing code.
1. Mutable data types with circular references and graceful degradation to immutable types:
2. Proper internal and user documentation
3. Better test suite
My main development platform is Windows, so the source archive primarily includes Microsoft Visual Studio project files. Microsoft provides a free edition of their development environment known as Visual Studio Express for those willing to compile and test the library without having to buy an expensive license. Other systems need a makefile and/or autoconf scripts.
I also uses a CentOS 5.2 Linux VMware image for Linux development, so the archive also includes minimalist GNU makefiles for building using the included GCC compiler. However it makes no use of other parts of the GNU toolchain (autoconf and the like).
The code is fairly portable on 32-bit systems. 64-bit support will need more work because all the internals are fine-tuned and optimized at the bit level; however porting to 64-bit should be rather straightforward: the algorithms will remain unchanged, structure access is abstracted behing macros, and cell size is proportional to the word size (a cell should be able to store 4 pointers, which add up to 16 bytes on 32-bit systems).
The only part that needs platform-specific code is the low-level page allocator. Colibri needs system calls that allocate boundary-aligned pages. At present both Windows and Unix (Linux) version is provided, the latter using mmap. Porting to other systems should require only minimal effort, as the platform-specific code is limited to a handful of functions gathered in a platform-specific source tree. Platform-specific peculiarities should not impact the overall architecture.
Exception handling is poor, especially because Colibri is meant to be part of a larger system that provides the appropriate infrastructure. "Exception handling" includes what to do upon allocation failures due to low-memory conditions. As Colibri uses a non-prehemptive model it cannot stop-the-world and GC like other implementations do to free memory. More generally, due to the nature of the model, such conditions would only occur when the memory is actually used or when the GC is not triggered often enough (for example during a long computation phase involving a large number of temporary allocations), both being unrecoverable anyway without explicit programming.
Tests have been run extensively during development, both on stability and performance. However Colibri lacks a real test suite (including unit testings). The source includes a test application that has to be hand-edited to run or customize specific tests. Note that some stress tests are configured in such a way that they require a system with a large memory size (2GB), so make sure to tune their parameters before running them.
Last, it lacks user and design documentation, although the source code is extensively commented.
A great side project would be to reimplement Tcl over Colibri as a replacement for the current Tcl_Obj based code. Of course the resulting library would be incompatible on an ABI level, but this would provide a great testbed for Colibri in real-world cases (using pure script applications) as well as a comparison point with the official Tcl core, and will possibly open the path to Tcl9. This most likely involves a lot of work.
Wiki page: https://wiki.tcl-lang.org/Colibri
Project page @ SourceForge.net: http://sourceforge.net/projects/tcl9/
Mailing list: http://sourceforge.net/mailarchive/forum.php?forum_name=tcl9-colibri
Direct Download:
The license is the same as for Tcl.
1. Added sequence and reference word types.
2. Type- and nil/NULL- related cleanup.
3. Improved source code documentation on the internal data structures.
1. Multithreading support.
2. Linux port and code portability improvements.
3. Test app overhaul.