Multiple Language Support

Marc Wachowitz mw@ipx2.rz.uni-mannheim.de
Tue, 6 May 97 21:33:54 +0200


Rainer Joswig <joswig@lavielle.com> wrote:
> >Unless you want just Scheme-emulation in Common Lisp (that's trivial),
>
> Not really. See Pseudo-Scheme.

I have a rough idea how Pseudo-Scheme works (though I didn't read and
analyze every line of it in detail), but I fail to see why you seem to
think that it would show that implementing Scheme on top of Common Lisp
would be non-trivial. Besides, it attempts to integrate Scheme with
Common Lisp much more tightly than one would have to do if one merely
wanted to offer a decent platform for Scheme, having the user ignore
the implementation language. That Pseudo-Scheme embodies certain design
choices (e.g. no general continuations, no exactness/inexactness) doesn't
imply that this would necessarily be non-trivial to do; the author just
preferred to keep it very similar to typical Common Lisp code. (Of course,
by "trivial" I mean that it wouldn't be hard to solve for someone with a
good understanding of both languages' semantics and the usual implementation
techniques. It may still be much work, but that would be either tedious
or would go much beyond the required functionality, e.g. very complicated
optimizations which aren't already in the basic Common Lisp system. You
can make almost everything non-trivial by adding clever optimizations ;-)

On the other hand, if you really want good _integration_, without having to
know where some data structure comes from, Pseudo-Scheme doesn't go very
far, since it mostly carries the Common Lisp semantics into Scheme for the
stuff which is hard to integrate, as mentioned before. Btw, I don't think
Guile's approach for compiling Emacs-Lisp to Guile is helpful either for
our question. As far as I can see, there is no very efficient solution
(by the measure of native code, not relative to interpretation overhead)
for Scheme data in Common Lisp code on typical processors, and not even an
inefficient general solution for Common Lisp data in Scheme code. Of course,
if you understand the context in which some value is generated _and_ used,
and the context is unambiguous wrt. symbol vs. empty list vs. boolean false,
you can use specific values/tests, extending both Scheme and Common Lisp.

-- Marc Wachowitz <mw@ipx2.rz.uni-mannheim.de>