Xref: utzoo comp.lang.forth:589 comp.lang.postscript:1005 comp.windows.news:806 comp.windows.misc:717
Path: utzoo!attcan!uunet!husc6!uwvax!rutgers!rochester!pt.cs.cmu.edu!cat.cmu.edu!ns
From: ns@cat.cmu.edu (Nicholas Spies)
Newsgroups: comp.lang.forth,comp.lang.postscript,comp.windows.news,comp.windows.misc
Subject: Re: type checking (I want PostScript) -- give NeWS a try!
Keywords: Forth, Lisp, Interactive PostScript, NeWS
Message-ID: <3094@pt.cs.cmu.edu>
Date: 24 Sep 88 17:27:44 GMT
References: <17702@glacier.STANFORD.EDU> <3566@druhi.ATT.COM> <13613@mimsy.UUCP> <102@unet.pacbell.COM> 
Sender: netnews@pt.cs.cmu.edu
Organization: Carnegie-Mellon University, CS/RI
Lines: 58

Could someone explain the relation between NeWS and Display PostScript? Also,
does anyone know _why_ PostScript and Forth are similar? Is it just a
consequence of both being stack-based, or was PostScript developed from 
Forth? Or from L* (L-star)? (L* was developed at CMU some years ago and also
used datatyping of stack items; sorry I don't name of its author offhand...)

I've always wondered what might constitute the smallest set of language
primitives that would allow the construction of an arbitrary number of
program constructs of arbitrary complexity (that is, "any program"). Forth,
as defined in F-83, has about 130 language primitives (of which, usually,
only a third or so are Forth "primitives" defined in machine code, depending
on the taste of the implementor).

In contrast, POP-11 (mentioned by Dick Pountain in Byte a while ago) is
based on a vitual machine that has only 17 instructions (it is also
stack-based). POP-11 combines aspects of Forth, LISP, Prolog and even Pascal:
it compiles to VM instructions and in interpreted (sort of like Forth); makes
extensive used of lists; has built-in sophisticated pattern-matching and
database support, but looks fairly much like a structured procedural
language. You also have access to compiler, as in Forth...

As a further digression, factorial of n can be calculated in POP-11 with:

define fact(n);
	if n == 1 then
		1
	else
		n * fact(n-1)
	endif;
enddefine;

Although Forth is fun to work with, its primitives seem rather arbitrary,
with (useful) oddities such as -TRAILING, >BODY and TIB having the same
official status as DUP and SWAP. Perhaps Forth standardization (which I
feel is sine qua non for its general acceptance) would benefit from factoring
and defining genuine, irreducable primitives on the one hand, and then
the environment/I-O aspects of the language in terms of these primitives,
of course leaving actual details of implementation to implementors.

Distilling Forth down to a smaller set of kernal primitives might make it
more consistant and, paradoxically, closer to the minimalist philosophy
espoused by Chuck Moore than Forth as it now exists...


Alpha-POP for the Mac is available from:

Cognitive Appliations Ltd	Computable Functions, Inc.
4 Sillwood Terrace		35 South Orchard Drive
Brighton			Amherst, MA 01002
BN1 2LR				413-253-7637
England

My only connection with Alpha-POP or its authors is as a satisfied customer.

-- 
Nicholas Spies			ns@cat.cmu.edu.arpa
Center for Design of Educational Computing
Carnegie Mellon University