[parenscript-devel] parenscript on parenscript?

Vladimir Sedach vsedach at gmail.com
Wed Jul 27 19:56:56 UTC 2011


Currently Parenscript uses some things from Common Lisp that aren't in
Parenscript. The three approaches to make PS self-hosting are:

1. Rewrite PS code in a DSL that can be compiled with Parenscript. For
example, replace car/cdr/etc. with destructuring and templating macros
that translate to car/cdr for CL and array access in JS. Then on the
JS side you'd construct your code from arrays instead of conses. The
only problematic thing is symbol representation.

2. Implement the missing CL features as a run-time library (add a cons
prototype with car/cdr methods).

3. Make a Common Lisp implementation that runs in JavaScript.

I think the last option is the most overall useful, and the most fun
to do. Parenscript then would (along with an existing CL
implementation) act as a "syslisp"/bootstrapping dialect and
cross-compiler. Red Daly already has large parts of the needed CL
runtime implemented in his PSOS project
(https://github.com/gonzojive/paren-psos).

How useful would Parenscript be in the browser? My guess is not very.
After all, it will just be a macro pre-processor over JavaScript's
eval, and anything you can do with that you're better off doing with
closures.

OTOH having a full Common Lisp on the browser (*with* a working ASDF)
would be pretty sweet. It would also be nice to have the full-featured
JS environments (V8, Rhino, SpiderMonkey) as another target for CL
deployment.

Vladimir

On Wed, Jul 27, 2011 at 7:24 AM, Anton Vodonosov <avodonosov at yandex.ru> wrote:
> Hello.
>
> I am new in parenscript and only glanced through the documentation on the project page.
>
> As I understand parenscript source is compiled to javascript using a CL implemented compiler.
>
> It's interesting, how difficult it is to have the same compiler implemented on javascript (i.e. on parenscript itself).
>
> As parenscript is a subset of CL, in theory it mitght be not difficult.
>
> The goal - is to have a browser only Lisp implementation, that can work without hunchentoot. To include parenscript
> scripts onto browser directly, redefine functions interactively and so on.
>
> What do you think?
>
> Best regards,
> - Anton
>
> _______________________________________________
> parenscript-devel mailing list
> parenscript-devel at common-lisp.net
> http://lists.common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
>




More information about the parenscript-devel mailing list