>So I'm finally ready to present a patch for the WPS tokenizer. >The basic idea is to store the WPS as an array of tokens.
>Please tell me what you think of the concept and the code. >IMHO this has the advantage of being much clearer, readable and maintainable than the current code. >As of performance, I don't have the confirmation that it's faster, but I think it should be, as it was designed >to make the parser do all the work. Binsize isa bit of a disappointment. I thought it could be smaller, >but instead I'm seeing a (small) increase on some targets (I haven't done much checking, though). I haven't yet looked at the code, but I think we could parse the WPS in a preprocessor plugin (don't call it a WPS compiler, it sounds intimidating), creating some "bytecode" that would be interpreted by the WPS viewer (really don't call it a WPS-VM, that's just sick). We can surely save core size as well as CPU cycles. All this can be made in a user-transparent way by having the preprocessing done by a viewer plugin, caching the result with a WPS timestamp/filehash to save future work. The real question is whether we can come up with a platform independent intermediate representation that captures all current (and hopefully future WPS aspects). My 2 cents, R.