<br><br><div><span class="gmail_quote">On 6/20/07, <b class="gmail_sendername">Vladimir Sedach</b> <<a href="mailto:vsedach@gmail.com">vsedach@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi John,<br><br>...there's currently no notion of "whole Javascript program"<br>in ParenScript, which besides wouldn't make sense if you're using<br>ParenScript to write inline scripts. If everything is going to get
<br>name-mangled, then there would have to be some escape procedure for<br>identifiers that you don't want to name mangle (functions in other<br>Javascript libraries). Plus, you'd have to have a way to "export"
<br>identifiers when you want to make your own functions for other<br>Javascript code to call. In short, I don't think there is a solution<br>to this that would work well in more than one use case.</blockquote><div><br>
<br>I prefer a Parenscript that departs from the exact semantics of
Javascript and a Parenscript compiler that performs more advanced
analysis. In this case, introducing the concept of a "whole
Parenscript program" would be beneficial to Parenscript developers. It
will not only allow a more sophisticated code generator (for minifying,
prefixing, etc.) but could also make it easier to extend the compiler,
generate documentation for a Parenscript program, and otherwise
manipulate Parenscripts programmatically. <br>
<br>I suspect that there are manageable solutions to problems like
inconsistent "name manglings" across different compilations. A package
system that keeps track of variable and function declarations can
resolve identifier references and rewrite them accordingly, leaving
global or unresolved identifiers alone. A few months ago I implemented
the first steps of a package system for Parenscript that does some
semantic analysis to accomplish prefixing as described.[1] I did not
attempt to solve the "inline scripts" issue, but that problem seems far
from impossible.
<br><br>Of course users have varying use cases. I write lengthy
programs in standalone .paren files. Others may use Parenscript quite
lightly to embed scripts in HTML. We can probably find solutions that
make everyone's life easier.
<br><br>I am generally of the opinion that Parenscript should be as close to
Lisp as possible. It is absurd that even in 2007 there is still so
much fuss over programming languages. It would be great if a separate Parenscript language did not need to exist.<br><br>-Red<br><br>[1] remnants of that work are in the darcs repository for the Suave project in the /suavescript/ directory:
<a href="http://common-lisp.net/project/suave/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://common-lisp.net/project/suave/</a> <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks,<br>Vladimir<br><br>On 6/19/07, John Fremlin <<a href="mailto:john@fremlin.org">john@fremlin.org</a>> wrote:<br>> Nowadays many things seem to want to include their JavaScript in your<br>> webpages. Aside from the fact that this is annoying, dangerous and
<br>> wrong, we have to accept that it is quite prevalent: from Google<br>> AdWords to ReCaptcha.<br>><br>> If I might add a feature request, it would be to be able to make sure<br>> that the identifiers generated by parenscript don't clash with
<br>> anything else.<br>> _______________________________________________<br>> parenscript-devel mailing list<br>> <a href="mailto:parenscript-devel@common-lisp.net">parenscript-devel@common-lisp.net</a><br>>
<a href="http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel">http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel</a><br>><br>_______________________________________________<br>parenscript-devel mailing list
<br><a href="mailto:parenscript-devel@common-lisp.net">parenscript-devel@common-lisp.net</a><br><a href="http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel">http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
</a><br></blockquote></div><br>