Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LispScript

32 views
Skip to first unread message

ric...@aiva.edinburgh.ac.uk.uucp

unread,
Nov 28, 1987, 3:46:09 PM11/28/87
to
A recent message to this list mentioned LispScript, which appears to be
a lisp-to-postscript translator. The message said
> ... the LispScript program isn't available generally ...
What does this mean? Is it available at a price, or what? Postscript
is such a revolting language that this sounds like a very useful program.
Perhaps the original poster could tell us about it?

Richard Tobin, JANET: R.T...@uk.ac.ed
AI Applications Institute, ARPA: R.Tobin%uk.a...@nss.cs.ucl.ac.uk
Edinburgh University. UUCP: ...!ukc!ed.ac.uk!R.Tobin

David Smyth

unread,
Nov 30, 1987, 6:32:42 PM11/30/87
to
In article <17331.87...@aiva.ed.ac.uk> ric...@aiva.edinburgh.ac.UK (Richard Tobin) writes:
>A recent message to this list mentioned LispScript, which appears to be
>a lisp-to-postscript translator. ...
> ... Postscript

>is such a revolting language that this sounds like a very useful program.

I was hoping it wasn't just me! How many others HATE postscript?
I'll summarize to the net.

Also, what would be a better language? PostScript reminds me of an
intermediate language generated by a compiler, not a language suitable
for human beings to think in. I propose a new language which is high
level, and is then compiled into postscript, with appropriate calls
to dbg for source level (NOT PostScript) debugging.

If you can't think of a specific language (I vote for C, or something
very much like C), indicate what language capabilities should be there.

Send today, I'll also bring this up at the Sun User's Group meeting Monday!

David Singer

unread,
Dec 1, 1987, 12:26:56 PM12/1/87
to

Well, I suppose I had better describe lispscript, since I am unable to see
C as an improvement on anything, even Postscript...

I wrote lispscript partly as a learning exercise and partly to make writing
postscript easier. It takes input in lisp notation and reader syntax, but
with postscript operators in functional positions. It recognizes a set of
'special forms' which it handles specially, and also recognizes macros,
whose expansion function obviously must be written in common lisp but
generate lispscript (i.e. lisp-ized postscript). On the way, it does almost
all your stack management for you -- the special form LET gives you compiler
(lexical) names for variables on the stack, and for all built-in operators and
user-defined functions defined with DEFUN lispscript does argument and result
count checking. As a result, there are a few things you can't write easily
in lispscript, but you can write a lot of code which is free of stack
overflow/underflow problems, off-by-one indexing and other plagues of the
postscript programmer. Lispscript optimizes both the input language (let
variables may be re-ordered to improve stack usage), and peephole optimizes
the outgoing postscript (generally optimizing the simple-minded stack
manipulations generated by the translation phase). It runs in two modes:
translating a file from lispscript to pure postscript, suitable for loading
into news or sending to a printer; or defining a lisp function, with
arguments, which has a postscript body which will be written down a stream
with argument substitution when the lisp function is called (i.e. it's a
CPS equivalent). Lispscript does binary encoding in this latter mode for
all expect floating numbers, and including user-defined tokens.

For me, the extra checking, the macro capability, and integration with my
current source language make this a win over raw postscript.

Ah yes, how do you get it? I'm currently trying to work out the best way
to get this out, I hope it will be Real Soon Now (seriously though).

Dave Singer
Schlumberger Palo Alto Research.

Steve Hyland

unread,
Dec 1, 1987, 1:17:55 PM12/1/87
to
In article <8...@devvax.JPL.NASA.GOV> d...@jplpro.JPL.NASA.GOV (David Smyth) writes:

>I was hoping it wasn't just me! How many others HATE postscript?
>I'll summarize to the net.

I don't HATE PostScript, but I agree that it is unsuitable for humans
to describe a page or document.

>Also, what would be a better language? PostScript reminds me of an
>intermediate language generated by a compiler, not a language suitable
>for human beings to think in. I propose a new language which is high
>level, and is then compiled into postscript, with appropriate calls
>to dbg for source level (NOT PostScript) debugging.

PostScript SHOULD be an intermediate language, albeit one generated by
an application such as an editor, in which users can design a page. I
think, for the most part, it is used primarily this way. I don't know
many people who sit down and design a document by writing a PostScript
program.

I think you are confusing the end and the means.

>If you can't think of a specific language (I vote for C, or something
>very much like C), indicate what language capabilities should be there.

Not to trash C or anything, but why on earth would I want to discard
PostScript for a language which is easily as terse as PostScript. If
you happen to program in C, you might find it very natural to describe a
document in a C-like language. I don't program in C, I program in Ada.
However, I'm not going to propose Ada as a candidate, because it would
still require humans to be fluent in that particular language to do something
as natural as describing a document.

If you want a specific language, I think natural language is the sensible
alternative, although difficult to implement. What would be better than:

:Center the page number at the bottom of the page.
:Center the following text and draw a box around it.
Some text to put on the page.
:Make three copies

or something like that.

Even this approach is not nearly as effective as the WYSIWYG editors that
have proliferated and which are capable of printing on a PostScript printer.

Steve Hyland
SAIC

Roy Smith

unread,
Dec 1, 1987, 8:27:39 PM12/1/87
to
In <8...@devvax.JPL.NASA.GOV> d...@jplpro.JPL.NASA.GOV (David Smyth) writes:
> PostScript reminds me of an intermediate language generated by a
> compiler, not a language suitable for human beings to think in.

Not having been privy to the inner thoughts that went on in the
minds of the original postscript implementers, I would guess that this is
exactly what they had in mind. Postscript is several things. It's a
powerful general-purpose programming language with built-in graphics
operators. It's easy to parse. It's device independant. And, while it is
indeed possible to write code directly in it, I don't think that is its
intended purpose.
--
Roy Smith, {allegra,cmcl2,philabs}!phri!roy
System Administrator, Public Health Research Institute
455 First Avenue, New York, NY 10016

Hugh Daniel

unread,
Dec 3, 1987, 1:11:26 PM12/3/87
to

Dave, I am not at ALL sure I want to program in C for NeWS! Maybe lisp
would do, but I am finding I LIKE haveing something that is NOT C like.
My consern is building better tools for NeWS to solve the programing
problem.
By the way, what is happening on monday that you would bring this up at?
All I know of at the moment (I havent been looking) the the Wendsday
SIG/BOF NeWS meeting?
||ugh Daniel

Bruce Becker

unread,
Dec 3, 1987, 1:12:16 PM12/3/87
to

Xlib and GKS aren't languages! Postscript is one, of a sort - the complaint
is to its abominable syntax - it's somewhat like programming in Forth, or
even a little like programming those old "smart" HP RPN calculators - it makes
you think backwards to other syntaxes. Some actually like doing this, but
it is easy to see that a simpler (NOT necessarily better/faster) interpreter
was the priority item over programmer-friendliness. Or so it looks from here..
SO, putting a "nice" front-end like LispScript (or even, in some contexts, the
SUN "compiler", is useful - sortof tames it a bit, like RatFor did for hoary
old Fortran...

Cheers, Bruce Becker Humber College Etobicoke, Ont.

0 new messages