Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #3988 > unrolled thread

PostScript Ideas Worth Resurrecting

Started byLawrence D'Oliveiro <ldo@nz.invalid>
First post2024-03-03 05:42 +0000
Last post2024-03-26 20:15 +0000
Articles 4 — 2 participants

Back to article view | Back to comp.lang.postscript


Contents

  PostScript Ideas Worth Resurrecting Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-03-03 05:42 +0000
    Re: PostScript Ideas Worth Resurrecting David Newall <ghostscript@davidnewall.com> - 2024-03-26 16:11 +1100
      Re: PostScript Ideas Worth Resurrecting Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-03-26 06:19 +0000
        Re: PostScript Ideas Worth Resurrecting Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-03-26 20:15 +0000

#3988 — PostScript Ideas Worth Resurrecting

FromLawrence D'Oliveiro <ldo@nz.invalid>
Date2024-03-03 05:42 +0000
SubjectPostScript Ideas Worth Resurrecting
Message-ID<us12kp$2bna6$1@dont-email.me>
PostScript, both as a language and as a graphics API, are just museum 
pieces now.

Nevertheless, there were some interesting ideas in the language part, that 
are still worth looking at. For example, executable arrays are basically 
functions as first-class objects. This is key to implementing control 
constructs (both conditional and looping) as straight built-in functions, 
with no special syntax of their own.

But these “function” objects do have some deficiencies: no (simple) 
support for reentrant local variables, and no lexical binding. Fix these 
up, and you have a much more useful language.

I have been playing off and on with a toy implementation of a PostScript 
variant with these characteristics. While I was at it, I added some stack-
safety features to try to make stack-based programming less confusing and 
error-prone.

I also got as far as implementing Python-style generator functions. But I 
think I might replace that in favour of something more ambitious, namely 
Scheme-style continuations.

[toc] | [next] | [standalone]


#3997

FromDavid Newall <ghostscript@davidnewall.com>
Date2024-03-26 16:11 +1100
Message-ID<3f1e7e13-10d3-4952-bc00-d10a5a1d4e40@davidnewall.com>
In reply to#3988
On 3/3/24 16:42, Lawrence D'Oliveiro wrote:
> But these “function” objects do have some deficiencies: no (simple)
> support for reentrant local variables, and no lexical binding. Fix these
> up, and you have a much more useful language.

% p1 p2 p3 f -  % demonstrate local variables and recursive parameters
/f {
  6 dict begin
   /p3 exch def
   /p2 exch def
   /p1 exch def
   /l1 (value) def
   /l2 (value) def
   /l3 (value) def
   ...
  end
} def

No?

[toc] | [prev] | [next] | [standalone]


#4001

FromLawrence D'Oliveiro <ldo@nz.invalid>
Date2024-03-26 06:19 +0000
Message-ID<uttpe5$1l948$3@dont-email.me>
In reply to#3997
On Tue, 26 Mar 2024 16:11:07 +1100, David Newall wrote:

> On 3/3/24 16:42, Lawrence D'Oliveiro wrote:
>
>> But these “function” objects do have some deficiencies: no (simple)
>> support for reentrant local variables, and no lexical binding. Fix
>> these up, and you have a much more useful language.
> 
> % p1 p2 p3 f -  % demonstrate local variables and recursive parameters
> /f {
>   6 dict begin
>    /p3 exch def
>    /p2 exch def
>    /p1 exch def
>    /l1 (value) def
>    /l2 (value) def
>    /l3 (value) def ...
>   end
> } def
> 
> No?

Notice I said “reentrant”?

[toc] | [prev] | [next] | [standalone]


#4003

FromLawrence D'Oliveiro <ldo@nz.invalid>
Date2024-03-26 20:15 +0000
Message-ID<utvad5$2b27a$1@dont-email.me>
In reply to#4001
On Tue, 26 Mar 2024 06:19:49 -0000 (UTC), I wrote:

> On Tue, 26 Mar 2024 16:11:07 +1100, David Newall wrote:
> 
>> On 3/3/24 16:42, Lawrence D'Oliveiro wrote:
>>
>>> But these “function” objects do have some deficiencies: no (simple)
>>> support for reentrant local variables, and no lexical binding. Fix
>>> these up, and you have a much more useful language.
>> 
>> % p1 p2 p3 f -  % demonstrate local variables and recursive parameters
>> /f {
>>   6 dict begin
>>    /p3 exch def
>>    /p2 exch def
>>    /p1 exch def
>>    /l1 (value) def
>>    /l2 (value) def
>>    /l3 (value) def ...
>>   end
>> } def
>> 
>> No?
> 
> Notice I said “reentrant”?

Sorry, that is of course reentrant. But it does dynamic binding, not 
lexical.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.postscript


csiph-web