Seriously though, you gotta be into S&M if you decide to develop something in Java yourself and you'll be doing part of the job.
Name:
TokenMacGuy2005-09-15 20:15
The main power of interned strings (and other such objects) is the pointer compare. if two immutable objects have the same pointer, then they have the same value as well; and by interning them, if they have unequal pointers, then the objects must also have unequal values.
This solves a common type of computing problem, but not all. Typically, processing the input of a large stream of text involves moving in and around a buffer, which you write to often, resize infrequently, and would never compare to another unit of text as a whole. Interning this buffer is a massive waste of memory and computation.
Java has a bit of a nice compromise, as far as strings are concerned, having both interned strings, (String and its descendants) as well as mutables (Buffer, and its descendants). Problem is, they are mutually incomprehensible. Most of the operations that involve processing text work on strings, but not on buffers. there is no suitable class adaptor since these methods assume that their arguments ARE immutable strings. No part of the Java language or API treat strings and buffers uniformly. The operations available to buffers are, at best, minimal, but more realistically, are broken. Working with buffers is still faced with interning and then collecting a large number of single-use, immutable strings.
Objective-C has a very similar API design to Java, with most of the same features in the Foundation.framework, but with one major difference. All structures are implemented both mutable and immutable, with immutables automatically interned (where appropriate), and all operations on those structures work in the expected fashion weather the object is mutable or immutable. It even has a built-in localization mechanism which is minimally invasive to the programmer. Objective-C's only boner is its garbage collection, or lack there of; reference counting is broken in Obj-C, since reference counting doesn't work period. Wish they'd switch to boehmGC or some other sensible mark and sweep. I am very fond of obj-c