[JR]
I do these performances with old iMac computers. And those you can only run up to 3.4 SuperCollider on them. So I use 3.4 for everything on those, like automating windows, OS scripts and things like this. And the control is so much better. For the document class is great, and everything is .rtf, so you can actually embed formatting and things like that into it. And there's a connection layer that connects to cocoa, which is the windowing system in OSX, so you can directly sen command to the windowing system and it's just incredibly powerful. I mean, you can make any kind of art form you want using the elements of the desktop and the elements of the windowing system. And users can't do that with the new SuperCollider IDE, because it doesn't have these cocoa bindings and stuff.
[HHR]
Well, but it is truly cross-platform now. That's the price you pay, in a way.
[JR]
It is, but it is not exposing all the the features of Qt either. So it is kind of like 'Ok, you do have this kind of robust, cross-platform windowing system. But you can't really get into it. And, I mean, I wish I knew the SuperCollider code base well enough to contribute to it. But I think if I did, the first thing I would do is expose all of the Qt document control methods and parameters and thing like that.
[HHR]
I mean, you run into the eternal problem that this will then cause compatibility issues immediately, after one year later. Something in the Qt bindings changes and the things doesn't work anymore. That's the advantage in a way of having a kind of abstract API, that is a little bit away from how everything is done in the implementation. So I'm wondering wether is not more fruitful to say "Look, for these kind of things, manipulating documents and windowing and so on I'm doing that in, whatever, Processing. I'm writing a little editor in Processing and there I have all the thing. You can communicate with SC lang, no problem.
[JR]
But you can also do this in SC. I mean, if you are fine with writing your own editor, that you can do in SC. You have the big monster which is TextView that has all of these features and things like these. And that is there. And in that context you do have quite a lot of control over indexing a buffer and that sort of stuff.
[HHR]
So what is the disadvantage then? Why you need the Document class if you say this is more powerful?
[JR]
Because you want to have your code that you are actually writing in SuperCollider be editable. And be manipulable. So all that happens in the IDE.
[HHR]
Can't that be done in a TextView? Is that too clunky … ?
[JR]
I guess you could. Executing would not be a problem. But syntax highlighting I do not know if that is available. You might have to do your own syntax highlighting which would be a pain to write. Or would just be a slough to write, it would not be difficult but it would be a lot of time and not very fun.
[POZ]
But maybe it already exists?
[HHR]
It exists. I copied it once to Java, a very long time ago when I did the Java client for SuperCollider. There was a function somewhere in the code base, at that time. It was still also the old one, before the IDE. There was some function somewhere which was called syntax highlight, it just takes the text buffer and meets the tokens.
[JR]
Ah, but it was still rtf at that time.
[HHR]
Yes, but you could abstract it. I think I was render it to HTML actually. So it is just a lexer basically, it is just a tokeniser that you need. You throw in a raw text and it gives you the tokens. Then for each token you decide what colour to give it. And is very crude, in the sense that you just throw the entire document every time you edit or change a character. But it's fast enough that you can do that. You don't need to have a dynamic lexer or something like that. Well, the current text editor for sure does the same. I'm sure it's not incremental. It just throws the current buffer in this function and returns the colours and that's it. You can probably translate that from C or whatever it is written in, into SC itself. I just don't know what the TextView can do, if it has a markup for colours and stuff like that.