I think you missed the main point: it's not necessary to create any new strings in order to parse an existing string (except perhaps for identifiers to be interned into symbol table if we're talking about a full programming language). If you need tokenization, represent those tokens as ranges. If you can avoid explicit tokenization, then it's even more efficient to just parse in-place directly (even if we don't care about real-time constraints).[0,2],[3,3],[7,2] is not a correct scenario for my purpose.
Its more like 3|2(1),-4|1(3) etc pattern, where the first its a 1/3 note in 2 beats (ch 1), the second one a muted 1/4 note in 1 beat (ch 3), and so on (I've lots of option, which are easy to represent in string with deterministic conventions).
You can literally parse almost every full programming language without ever taking substrings except perhaps to intern new identifiers to a symbol table... and if you don't have symbols to intern, then there's no reason you would ever need to allocate.
Statistics: Posted by mystran — Sat May 18, 2024 7:40 pm