[comp.lang.scheme] Scheme as the only extension language

ramsdell@mitre.org (John D. Ramsdell) (08/28/90)

It would be nice if Scheme replaced other lisp-like extensions
languages.  Of course, I do not expect this to happen, but it would be
nice.  Some contributors to this news group have suggested that
Scheme's use should be more general.  They point to TeX and PostScript
as examples of extension languages that could benefit from the ideas
in Scheme.  Taking this even further, is there anyone who asserts that
Scheme could be the right extension language for a TeX-like or a
PostScript-like system?  How would you integrate the text with Scheme
code?
John

peter@ficc.ferranti.com (Peter da Silva) (08/29/90)

In article <RAMSDELL.90Aug28065744@huxley.mitre.org> ramsdell@mitre.org writes:
> Taking this even further, is there anyone who asserts that
> Scheme could be the right extension language for a TeX-like or a
> PostScript-like system?  How would you integrate the text with Scheme
> code?

Use some escape character to indicate the beginning of scheme code. Read
one symbol or list at that point and evaluate it. Discard the result if it's
nil, otherwise treat it as replacement text. You would have stuff inserted
in your text like @(date) or @(set! ux '"UNIX(TM)") or @ux.
-- 
Peter da Silva.   `-_-'
+1 713 274 5180.   'U`
peter@ferranti.com

barnes@cadence.com (Tim Barnes) (08/29/90)

In article <RAMSDELL.90Aug28065744@huxley.mitre.org> ramsdell@mitre.org (John D. Ramsdell) writes:

> It would be nice if Scheme replaced other lisp-like extensions
> languages.  Of course, I do not expect this to happen, but it would be
> nice.  Some contributors to this news group have suggested that
> Scheme's use should be more general.  They point to TeX and PostScript
> as examples of extension languages that could benefit from the ideas
> in Scheme.  Taking this even further, is there anyone who asserts that
> Scheme could be the right extension language for a TeX-like or a
> PostScript-like system?  How would you integrate the text with Scheme
> code?
> John

Scheme is very attractive as an extension language, because it's small,
potentially quite efficient (simple data structures; optimized tail
recursion etc.), very powerful (continuations, delay/force etc.) and has
a good model for interactive use (a critical attribute, in my view).

The CAD Framework Initiative recently saw presentations of eight CAD
System Extension Languages, of which six were lisp-based.  

I believe that the extension language for the Interleaf desktop
publishing system is a dialect of lisp, and I know that the "Make
Interchange Format" (MIF), supported by Frame (also a desktop publishing
system would be "lisp-like" or "EDIF-like" (if you're from the
electronic CAD industry) if you changed "<" to "(" and ">" to ")".

As we know from Gnu emacs, lisp is a very successful extension language
for text processing systems.  
--
   /		   /    Manager, Framework Technology - Cadence Design Systems
 -/-  o		  /__  ___  __	___  ___  ___             2455 Augustine Drive
 /   / /\  /\	 /  / ___/ /   /  / /__/ /__        Santa Clara, CA 95054-3082
/__ / /	 \/  \  /__/ /__/ /   /  / /__  ___/ barnes@cadence.com (408) 987 5417

grunwald@foobar.colorado.edu (Dirk Grunwald) (08/29/90)

r>PostScript-like system?  How would you integrate the text with Scheme
r>code?
--

I think that integrating the scheme code with the text is a BAD IDEA
in both TeX and postscript.

Consider attempting to TeX a portion of a document; you can't, because
the global state can set stuff waaaay in the front of the document.
By distinguishing the macros/functions from the text, you gain the
ability to process document fragments.

I like Emacs where you don't define C-mode functions in the middle of
e.g., your C programs.

This is more like SGML systems, and why systems like The Publisher use
SGML and impose a similar restriction (no macros in the middle of your
file).

manis@cs.ubc.ca (Vincent Manis) (08/30/90)

Re: Scheme as an extension language for TeX.

In the early 1970's, a number of us, grad students at the time, designed
a document formatter whose extension language was Lisp 1.5. For reasons
of performance, we gave up on the idea, and designed a second language
which was based upon TRAC (TM of Calvin Mooers). The resulting
formatter, Texture, had some considerable success and use, dying only
when proportional fonts became available. 

Of course you could do TeX with Scheme (all TeX really is is a system
for setting boxes with glue). You'd need to add a few trivial things to
R^4S Scheme, such as read macros (to support catcodes), as well as the
specific typesetting operations (such as make-box, make-glue, make-rule,
make-leader, and so on). It would be really fantastic!

On the other hand, I have a fair bit of affection for Knuth's perverse
language. Say what you might about it, there's nothing quite like it.
(``Madom, this meal is indescribable!'') 

--
\    Vincent Manis <manis@cs.ubc.ca>      "There is no law that vulgarity and
 \   Department of Computer Science      literary excellence cannot coexist."
 /\  University of British Columbia                        -- A. Trevor Hodge
/  \ Vancouver, BC, Canada V6T 1W5 (604) 228-2394