The Artima Developer Community
Sponsored Link

Weblogs Forum
A Big Jar of String

1 reply on 1 page. Most recent reply: Jun 2, 2003 5:47 PM by Frank Mitchell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Carlos Perez

Posts: 153
Nickname: ceperez
Registered: Jan, 2003

A Big Jar of String (View in Weblogs)
Posted: May 15, 2003 8:12 AM
Reply to this message Reply
Summary
Tim Bray has an interesting set of blogs that's keeping me on the edge. Tim is essentially saying that Java's immutable String class isn't suited for "heavyweight" text processing tasks. That's a big claim since there's just too many applications that require heavy text processing.
Advertisement

Tim Bray has an interesting set of blogs that's keeping me on the edge:

So for Java, should we abandon String and do all our work with char[] constructs? I don't think so, simply because I think the char primitive is just too deeply broken. Also, I want to use tricks like strcmp() and strncat(), beloved of grey-bearded Unix veterans.

Gasp! Surely he's not suggesting that we retreat to putting everything in a byte[] construct, and presumably revert to living in caves and courting women with clubs?!? Well no, because I am an object-oriented kinda guy, when I can get away with it. So, how do we get the heavy industrial machinery for doing superior text processing in modern languages without compromising their virtues? Stay tuned.

What could he have up his sleeve?

Tim is essentially saying that Java's immutable String class isn't suited for "heavyweight" text processing tasks. That's a big claim since there's just too many applications that require heavyweight text processing (i.e. parsers, information retrieval, semantic analysis, etc). Tim is saying that you can't scale using String or its dual StringBuffer for these types of applications! Now, I can only guess what he's trying to brew together, however I do recall a couple of alternative String (rather byte[] based) implementations for Java.

Imagine, a comprehensive jar for heavy duty string processing! Now I'm just waiting for?some "wisdom" to?string this all together. Tim, ever consider starting a JSR?


Frank Mitchell

Posts: 37
Nickname: fmitchell
Registered: Jan, 2003

Re: A Big Jar of String Posted: Jun 2, 2003 5:47 PM
Reply to this message Reply
There's also the notion of "cords" or "ropes", which represent long strings as binary trees whose leaves are small sequences of characters. Strings can still be immutable, but concatenation only creates a root node with references to the two sub-ropes, and substrings can reuse many of the nodes in a subtree without copying.

See http://www.sgi.com/tech/stl/Rope.html for a description of the C++ STL implementation.

Flat View: This topic has 1 reply on 1 page
Topic: Recoverable Remote Exceptions with Jini Previous Topic   Next Topic Topic: Refactoring To Aspects

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use