help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About Emacs Modernisation Project


From: Pascal J. Bourguignon
Subject: Re: About Emacs Modernisation Project
Date: Wed, 08 Dec 2010 15:10:50 -0000
User-agent: Gnus/5.101 (Gnus v5.10.10) Emacs/23.1 (darwin)

LanX <lanx.perl@googlemail.com> writes:

> Hi
>
>> Do you realize that lisp is actually a very small core language?
>> (eval fits on a single page).
>
> I think that I made quite clear that I want this c/js/perl-style
> representation (lets call it PSILe) to be transformed to eLISP
> _before_ compilation.
>
> Macros will still work on the plain eLISP representation.
>
> (of course defining macros for PLISe wouldn't be easy feasible, but
> normal users won't miss macros...)
>
> The tricky part would be to find a representation that works without
> ambiguities in both directions, such that old lisp code could be used
> as a base for this "new" coding.
>
> I don't know if it's really feasible but it's for sure an interesting
> task.
>
> PLISe <-> eLISP -> Macro expansion -> compilation -> execution

It is effectively entirely feasible.  

See for example parenscript (and jwacs) in CL.
http://common-lisp.net/project/parenscript/
(or Liskell for another example, but there are a lot of them).

Parenscript is a set of functions and macros that allows you to write
javascript code as lisp sexps.  The point of course is to allow
lispers (emacs users) to be able to write barbaric languages
(languages with barbaric syntaxes), on one hand, and to be able to
define macros for these barbaric languages on the other hand (the
macros written in lisp would transform parenscript forms into
parenscript forms, before being translated to Javascript).

(jwacs does the reverse transformation, parsing Javascript and
producing lisp objects; I used it once to revert to the parenscript
form so that I could go between both syntaxes).

This covers the first <-> arrow.


Now to compile parenscript to Common Lisp, you would still need to
implement a run-time library of javascript semantics in lisp (eg. the
object system is quite different, the data types, etc).  In general,
the core languages are easy to translate to Lisp, since they're often
much less sophisticated than Lisp. 

-- 
__Pascal Bourguignon__
http://www.informatimago.com


reply via email to

[Prev in Thread] Current Thread [Next in Thread]