[parenscript-devel] Lexical scoping bug
danielgackle at gmail.com
Wed Apr 21 06:10:01 UTC 2010
Very interesting. So basically, you'll still need a runtime library to
execute PS code in a CL environment, but you won't need an interpreter.
(This is an observation Scott made to me earlier today.) Is that correct?
It's a neat insight to have observed how close PS was to being able to make
this work. That is, it's a big task, but not nearly as big as one would have
I'm curious as to what you propose to do with this capability. What
One I can think of that would get me excited is the ability to evaluate PS
forms in Slime (or something like it... Pslime anybody?). Perhaps this could
even be hooked into sldb for the purpose of debugging PS code in a much more
friendly environment than the likes of Firebug, not least because it would
be linked to PS source rather than generated JS.
On Tue, Apr 20, 2010 at 1:04 PM, Vladimir Sedach <vsedach at gmail.com> wrote:
> > What is the motivation for using lists as the intermediate form rather
> > CLOS objects? I suppose that s-expressions makes it easy to use
> > tree-walking functions out of the box, but there seem to be disadvantages
> > when it comes to separating syntax from semantics, e.g. addressing the
> > 'else' form of an if via (third if-statement) vs. (if-statement-else
> > if-statement).
> > I have not seen the intermediary form and I am sure you have good
> > but it is not the direction I would have gone. Could you explain the
> > perhaps with some motivating examples, to enlighten us all?
> Here's an example of what the current intermediate form looks like:
> (compile-statement '(defun blep (ss x y)
> (when foo?
> (let ((pair (bar)))
> (unless (null pair)
> (destructuring-bind (a b) pair
> (unless (or (null a) (null b))
> (let ((val (baz a b)))
> (unless (null val)
> (when (blah val)
> (unless (blee)
> (JS:DEFUN BLEP (SS X Y)
> (JS:IF FOO?
> (JS:BLOCK (JS:VAR PAIR (JS:FUNCALL BAR))
> (JS:IF (JS:!== PAIR NIL)
> (JS:BLOCK (JS:VAR A (JS:AREF PAIR 0)) (JS:VAR B (JS:AREF PAIR 1))
> (JS:IF (JS:! (JS:|\|\|| (JS:=== A NIL) (JS:=== B NIL)))
> (JS:BLOCK (JS:VAR VAL (JS:FUNCALL BAZ A B))
> (JS:IF (JS:!== VAL NIL)
> (JS:IF (JS:FUNCALL BLAH VAL)
> (JS:IF (JS:! (JS:FUNCALL BLEE))
> (JS:BLOCK (JS:RETURN T)))))))))))))))
> As you can see, all you need is to define some functions and macros,
> and the resulting code is ready to be EVALed or compiled.
> > Go, Vladimir, go! That's an ambitious project but I would love to see it
> > happen!
> > printer already. See http://github.com/gonzojive/js-parser
> > included a pretty printer and an obfuscating printer that would obfuscate
> > extra syntax additions.
> > everything, but you should be able to avoid writing the parser yourself,
> > the very least.
> Thanks for the pointer. I didn't know you based your parser on JWACS'.
> I took a look at JWACS when starting, but decided to base mine on
> Marijn Haverbeke's parse-js (http://marijn.haverbeke.nl/parse-js/);
> it seemed easier to modify.
> >> One user-visible change I made in the latest patches is to encourage
> >> use of CL equality predicates ('==' and '===' are still there but
> >> marked as deprecated).
> >> Vladimir
> > Red
> >> 2010/4/19 John Pallister <john at synchromesh.com>:
> >> > +1, as they say...
> >> >
> >> > ++Thanks,
> >> >
> >> > John :^P
> >> >
> >> > On Mon, Apr 19, 2010 at 12:42 AM, Daniel Gackle <
> danielgackle at gmail.com>
> >> > wrote:
> >> >> For those of us who are curious, could you talk a bit about the work
> >> >> you did
> >> >> on the compiler?
> >> >> Thanks Vladimir,
> >> >> Daniel
> >> >
> >> > _______________________________________________
> >> > parenscript-devel mailing list
> >> > parenscript-devel at common-lisp.net
> >> > http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
> >> >
> >> _______________________________________________
> >> parenscript-devel mailing list
> >> parenscript-devel at common-lisp.net
> >> http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
> > _______________________________________________
> > parenscript-devel mailing list
> > parenscript-devel at common-lisp.net
> > http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
> parenscript-devel mailing list
> parenscript-devel at common-lisp.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the parenscript-devel