"Vladimir Sedach" vsedach@gmail.com writes: --text follows this line--
That sounds like a good idea, but I think it would be difficult to implement correctly. The problem is that name mangling would have to take place both when you declare the variables/functions, and when you access them. So there would have to be some global state to keep track of which identifiers have already been declared in ParenScript code so that the corresponding name-mangling could take place when those identifiers are accessed.
Yes, I am well aware. If it didn't involve so much hard work, I would have done it already.
However, this is another motivation for parenscript moving more towards being a proper Lisp to JavaScript compiler. Eventually, being able to run the same code in Lisp on the server as in JavaScript on the client would obviously be awesome.
The definition tracking functionality would also be useful for code-compression (choosing short identifiers) as someone else suggested.
Of course, I suppose constant folding (as you suggested) is the first step and would definitely be much more practical.
[...]