I think the general use case is a sort of Parenscript library that is quite fixed and only uses identifiers in itself. The name references inside this library can presumably be all resolved at the host lisp's compile time.
I think the important thing is to keep in mind that the time at which the ParenScript code gets "compiled" (however shallowly) into Lisp and the time at which that code gets compiled into Javascript don't necessarily have to be the same. This is what buys the name resolution in my proposed design relatively cheaply (from the standpoint of the cost of adding things to the ParenScript compiler).
Then there are numerous small bits of JavaScript shoved into each page as event attributes or <script>s or whatever. It is unlikely that these things will modify the PPP (if they did, then you would have to have one PPP per page).
Not necessarily. I was thinking you could have a form like (in-parenscript-package PPP) that would set some special variable indicating the PPP/namespace that the forthcoming ParenScript code would use for its identifiers. At compile time, the namespace would be populated and its binding done for name resolution, however the actual resolution of identifiers wouldn't take place until the JavaScript code was emitted.
I'm not sure that name-mangling (helpful by-product: spell-checking of identifiers) would really use the "lisp code templates to generate a string" functionality.
I think it would have to, otherwise how would forward references be resolved?
Thanks, Vladimir