[chuck-dev] string support

Joachim Ganseman musicalign at gmail.com
Mon Oct 27 12:40:09 EDT 2008


Hello,

After some experiments of my own, and following the tutorial at
ISMIR'08, I'd like to see if I can contribute something to ChucK. Main
thing that I'd like to see added is support for strings. Not much, but
in such a way that a fairly common thing like a parser could be
written. I work with MusicXML myself, and I'd love to be able to parse
a music score in ChucK.

Outputting and concatenating is a good beginning, but what I'd like to
see is e.g. an [] operator to select characters in a string (treating
it as an array), eventually augmented with some basic functionality
like the things that can be found in the C++ STL or the Java standard
library.

Before I dive blindly into the code and hacking things together, I'd
like to open this up for discussion first:
- a lot of C++ STL implementations are infamous for not being
threadsafe. Shredsafeness seems to me however a first requirement.
True or false? If anyone has some good pointers or links on this
issue, please let me know!
- Any major programming language today has to be able to process
Unicode strings. This also brings up the problem of different
encodings, etc... Perhaps it's a good idea to model strings after
Java, and have a look at how Java VM's do it?
- After giving it some thought I'd like to avoid introducing a
character datatype, and instead regard a character as a string with
length 1. There's already types enough in this world. But is this
feasible, or do I miss something which would require a character type?
- Is it perhaps easier to integrate a string library from another open
source project instead of writing an own library? Pointers and links
very welcome!
- Java and C++ have very different ways of handling strings. In Java
all strings are managed in a pool in the VM and only references to
them are used at runtime, while in C++ you can endlessly screw around
with pointers to char arrays. Which paradigm is preferable in ChucK?
(personally, I tend to say Java, but then again, I truly hate the
difference between the == and .equals() operators messing with my
mind)

I don't have much spare time so I'm not going to promise that I'm even
going to start working on this - if the task at hand would eventually
seem to be too big, It's perhaps better for a grad student's
project...


All the best from Belgium,

Joachim Ganseman
PhD student @ Visionlab
University of Antwerp
Belgium


More information about the chuck-dev mailing list