string overhaul

Ralf Juengling <[email protected]> Fri, 2 Mar 2007 16:57:02 -0800 (PST)
Newsgroups gmane.lisp.lush.devel
Message-ID <[email protected]>
Hi,

The representation of string objects by the interpreter
and by the compiler is different at the moment. For
the interpreter it's an object of builtin class STRING
and it maintains a pointer to a C-style (null-terminated)
string, the compiler stores strings in ubyte storages
(with a redundant \0 terminator to be compatible with C
functions).

It's ugly because the string data is being copied back
and forth each time the line of execution crosses the
boundary between interpreter and compiled code (it seems).
I would like to unify the representation and use storages
on both sides. I would introduce a new storage class
"character", say, which internally is equivalent to
ubyte (a "wide-character" class could be added later),
so that strings are still distinguishable from ubyte
storages. These character storages would be read-only,
but it's conceivable to allow some string functions to
work with ubyte storages as well, so that we effectively
would have mutable and immutable strings.

I haven't really thought that much about it and was
wondering if you would go about this differently.
Any thoughts?

Ralf


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV