On 7/26/06, Martin Peach martin.peach@sympatico.ca wrote:
padawan12 wrote:
I see a free software tool that does what Pd does and outputs code as an inevitability, sooner or later, it's just the logical thing to do. It's just that I'm rather scratching my head wondering why it doesn't do so already. Perhaps I've forgotten some fundamental reason why exploding the netlist into a code listing might not be trivial, reenterancy maybe,
Well possibly the fact that most pd patches are not strictly procedural, a list of instructions that is run through once. Messages can arrive at any time to modify what is going on... PD is already written in C and is basically a scheduler that calls functions at the appropriate times based on the messages the functions are emitting. It seems to me you can't get any further than that in C. Sure you can manually write any particular patch more efficiently as a standalone program but I doubt there is a general way to do that since there is no way to predict every possible state of every possible patch, hence no way to guarantee that a program is really the same as the original patch. IMHO, Martin
Does Pd actually replace the objects in a patch with their machine code? It seems like, if the behavior of the program and the behavior of any one object are derived from C code, you could just plug the necessary pieces of C code together in the same relationships as the objects in the patch. I don't think the extra step of then compiling the C code would be much of a PITA for anyone using Pd. If you really wanted a small program, you could even take out parts of objects you don't need, if that doesn't violate anyone's license. As in, if you have no [/~] objects, take that section out of the signal math file. Kind of the way Csound works. Maybe it wouldn't be much benefit for existing Pd users, but I bet it would draw new users in. Then again, I realize it wasn't part of the original vision behind Pd; but that needn't stop it.