This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: difficulty of writing translators



Jim Blandy <jimb@red-bean.com> writes:

 > Maciej Stachowiak <mstachow@mit.edu> writes:
 > 
 > > * Scheme has only one namespace, whereas elisp and Common Lisp have
 > > separate namespaces for variables and functions (and in the case of
 > > Common Lisp a bunch more too, sigh).
 > 
 > Elisp has a pretty explicit concept of a symbol object and its slots.
 > I think the Scheme binding space should be completely distinct, with
 > magic happening when you import an Elisp module into Scheme.  (Or,
 > since Elisp has no modules, maybe I should say "the Elisp module".)

I don't see exactly what the problem is.  I suppose there are big
problems if you contemplate trying to map elisp fcns to their
corresponding scheme functions, but are there big problems just
implementing an elisp interpreter in scheme?  So that, for example,

   (f x)

from elisp maybe expands to something like:

   ((elisp:function-value 'f elisp:current-env)
    (elisp:variable-value 'x elisp:current-env))

which is evaluated by the scheme interpreter.

Or (f x) is read by an elisp:read-eval loop which tracks the
appropriate environments, looks up values in the appropriate places,
etc.

It's frustrating, given that elisp & scheme are so close, that one
would have to write a full elisp interpreter instead of just sort of
mapping a handful of symbols to other symbols and directly
interpreting them.  But why is this a big hurdle?

-- 
Harvey J. Stein
BFM Financial Research
hjstein@bfr.co.il