30 Dec 2000 gmc333   » (Journeyer)

I've been thinking of the potential of adding two new basic data types to Eiffel: BIT_S and BIT_U. These would be similar to the BIT classes already present in SmallEiffel. The basic notion is that you could then declare subclasses to create signed and unsigned integers of arbitrary size. The compiler then optimizes the manipulation of the variables according to the word size of the target machine.

The main reason for doing this? Standard Eiffel only has one integer type. No support for unsigned integers at all, and no direct support for the rich variations found in C or C++. This limits the types of applications for which Eiffel is suitable. (For example, there is no equivalent of a short unsigned int, which would be a useful basis for implementing UTF16 support.)

Almost as bad, the basic INTEGER class for most Eiffel compilers depends on the back end C compiler you use. It maps directly to "int". This is unlike Java, which bit the bullet and standardized integer size on all platforms. This limits portability of the source. Perhaps not as much as some might think; the SmallEiffel compiler supports a pretty broad range of machines. But I think it will become a bigger issue as more 64-bit architectures become available and compilers start to wrestle with the greater length. I'm old enough to remember the grief caused in trying to write code that supported both 16-bit and 32-bit platforms.

By introducing just two new types, we adhere to the RISC- language precept of Eiffel. This is in contrast to the SARITH proposal floated a while back in the Eiffel community, where a large family of integer types was proposed.

The types could greatly expand Eiffel's utility in interfacing to legacy code, operating in embedded systems and efficiently implementing new libraries and features (like UTF16 support mentioned earlier.)

If and when I polish up a firm proposal, I'll be posting it to my Web site and one or two newsgroups, and perhaps a couple other places.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!