Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #349: Stray Alpha Particles from memory packaging caused Hard Memory Error on Server.


comp / comp.lang.misc / Re: On Stack-Based Languages (was Re: on Perl)

SubjectAuthor
* Re: On Stack-Based Languages (was Re: on Perl)Lawrence D'Oliveiro
`* Re: On Stack-Based Languages (was Re: on Perl)David Brown
 +* Re: On Stack-Based Languages (was Re: on Perl)Lawrence D'Oliveiro
 |`* Re: On Stack-Based Languages (was Re: on Perl)James K. Lowden
 | `- Re: On Stack-Based Languages (was Re: on Perl)Lawrence D'Oliveiro
 `- Re: On Stack-Based Languages (was Re: on Perl)Anssi Saari

1
Subject: Re: On Stack-Based Languages (was Re: on Perl)
From: Lawrence D'Oliv
Newsgroups: comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 18 Apr 2024 07:55 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer, comp.lang.misc
Subject: Re: On Stack-Based Languages (was Re: on Perl)
Date: Thu, 18 Apr 2024 07:55:42 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <uvqjlu$257pa$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <87edbtz43p.fsf@tudado.org>
<0d2cnVzOmbD6f4z7nZ2dnZfqnPudnZ2d@brightview.co.uk>
<20240408075547.000061e8@gmail.com>
<g52cnWOOwoz_son7nZ2dnZfqnPWdnZ2d@brightview.co.uk>
<uvbe3m$2cun7$1@dont-email.me>
<Mkidnafag8vlooH7nZ2dnZfqn_idnZ2d@brightview.co.uk>
<pan$c8c3e$b0e492b3$c544c27e$d72bff90@invalid.invalid>
<uvk8o6$h2pg$3@dont-email.me> <20240415152951.000079ab@gmail.com>
<uvkbec$hjeq$1@dont-email.me> <uvlc1f$rgng$1@dont-email.me>
<slrnv1smf9.25p4.naddy@lorvorc.mips.inka.de> <uvlp8g$u62e$1@dont-email.me>
<87wmowv9fy.fsf@eder.anydns.info> <20240417080523.00005e99@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 18 Apr 2024 09:55:42 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="e0bbc97582f840a25b6ae44a96748375";
logging-data="2268970"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/YqkxxL3EgISE42t/jwUlA"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:PMHcDEjIWv3Ro9m+qYfVfW8k6qg=
View all headers

On Wed, 17 Apr 2024 08:05:23 -0700, John Ames wrote:

> *Syntactically* it's very simple, but explicit stack-orientation with
> reverse-Polish notation is a *very* different programming paradigm than
> practically everything else out there ...

The only really tricky part of stack-based programming is keeping track of
what’s on the stack.

I did some messing about with a reboot of PostScript which tried to add
some niceties, like stack guards and lexical binding. Here’s an example of
the sort of thing I was able to get working (“ddef” and “dstore” define
and assign to dynamically-bound variables, while “ldef” and “lstore”
correspondingly work on lexically-bound ones):

/Count 99 ddef

/metatry
{ % provides context for nonlocals
dup
/Name exch ldef
/Count 0 ldef
{ % actual proc
/Count dup lload 1 add lstore
/Count dup dload 1 add dstore
Name =
(local Count = ) print /Count lload =
(global Count = ) print /Count dload =
(whichever Count = ) print Count =
}
}
ddef

/try1 metatry ddef
/try2 metatry ddef

try1
try2
try1
try2

Output:

try1
local Count = 1
global Count = 100
whichever Count = 1
try2
local Count = 1
global Count = 101
whichever Count = 1
try1
local Count = 2
global Count = 102
whichever Count = 2
try2
local Count = 2
global Count = 103
whichever Count = 2

Subject: Re: On Stack-Based Languages (was Re: on Perl)
From: David Brown
Newsgroups: comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 18 Apr 2024 08:37 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.unix.programmer,comp.lang.misc
Subject: Re: On Stack-Based Languages (was Re: on Perl)
Date: Thu, 18 Apr 2024 10:37:47 +0200
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <uvqm4r$25k0u$3@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <87edbtz43p.fsf@tudado.org>
<0d2cnVzOmbD6f4z7nZ2dnZfqnPudnZ2d@brightview.co.uk>
<20240408075547.000061e8@gmail.com>
<g52cnWOOwoz_son7nZ2dnZfqnPWdnZ2d@brightview.co.uk>
<uvbe3m$2cun7$1@dont-email.me>
<Mkidnafag8vlooH7nZ2dnZfqn_idnZ2d@brightview.co.uk>
<pan$c8c3e$b0e492b3$c544c27e$d72bff90@invalid.invalid>
<uvk8o6$h2pg$3@dont-email.me> <20240415152951.000079ab@gmail.com>
<uvkbec$hjeq$1@dont-email.me> <uvlc1f$rgng$1@dont-email.me>
<slrnv1smf9.25p4.naddy@lorvorc.mips.inka.de> <uvlp8g$u62e$1@dont-email.me>
<87wmowv9fy.fsf@eder.anydns.info> <20240417080523.00005e99@gmail.com>
<uvqjlu$257pa$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 18 Apr 2024 10:37:47 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a0080b8d6f1ecc9cfec5050a64ed5ac7";
logging-data="2281502"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/nmtKZkxQy0dPttQW2VjxnMSYpQ29sdPw="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:of4pEzub9kJediHsDURzwwlrqGc=
Content-Language: en-GB
In-Reply-To: <uvqjlu$257pa$1@dont-email.me>
View all headers

On 18/04/2024 09:55, Lawrence D'Oliveiro wrote:
> On Wed, 17 Apr 2024 08:05:23 -0700, John Ames wrote:
>
>> *Syntactically* it's very simple, but explicit stack-orientation with
>> reverse-Polish notation is a *very* different programming paradigm than
>> practically everything else out there ...
>
> The only really tricky part of stack-based programming is keeping track of
> what’s on the stack.
>
> I did some messing about with a reboot of PostScript which tried to add
> some niceties, like stack guards and lexical binding. Here’s an example of
> the sort of thing I was able to get working (“ddef” and “dstore” define
> and assign to dynamically-bound variables, while “ldef” and “lstore”
> correspondingly work on lexically-bound ones):
>

I think I have only ever heard of one person who actually uses
PostScript for programming by hand, rather than as a print output
format. That is Don Lancaster, an electronics engineer who is a big fan
of "magic sines" (binary strings with low harmonics) and does all his
coding in PostScript. Anyone wanting to see a significant library of
PostScript code might be interested.

<https://www.tinaja.com/magsn01.shtml>

Subject: Re: On Stack-Based Languages (was Re: on Perl)
From: Lawrence D'Oliv
Newsgroups: comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 18 Apr 2024 08:44 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer,comp.lang.misc
Subject: Re: On Stack-Based Languages (was Re: on Perl)
Date: Thu, 18 Apr 2024 08:44:44 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <uvqmhs$25pds$3@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <87edbtz43p.fsf@tudado.org>
<0d2cnVzOmbD6f4z7nZ2dnZfqnPudnZ2d@brightview.co.uk>
<20240408075547.000061e8@gmail.com>
<g52cnWOOwoz_son7nZ2dnZfqnPWdnZ2d@brightview.co.uk>
<uvbe3m$2cun7$1@dont-email.me>
<Mkidnafag8vlooH7nZ2dnZfqn_idnZ2d@brightview.co.uk>
<pan$c8c3e$b0e492b3$c544c27e$d72bff90@invalid.invalid>
<uvk8o6$h2pg$3@dont-email.me> <20240415152951.000079ab@gmail.com>
<uvkbec$hjeq$1@dont-email.me> <uvlc1f$rgng$1@dont-email.me>
<slrnv1smf9.25p4.naddy@lorvorc.mips.inka.de> <uvlp8g$u62e$1@dont-email.me>
<87wmowv9fy.fsf@eder.anydns.info> <20240417080523.00005e99@gmail.com>
<uvqjlu$257pa$1@dont-email.me> <uvqm4r$25k0u$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 18 Apr 2024 10:44:45 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="e0bbc97582f840a25b6ae44a96748375";
logging-data="2287036"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ksLsSTwkWGgHuF2Ytm/FE"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:Cz+BGt9kTAWTEnX39GitOfc6RqU=
View all headers

On Thu, 18 Apr 2024 10:37:47 +0200, David Brown wrote:

> I think I have only ever heard of one person who actually uses
> PostScript for programming by hand, rather than as a print output
> format. That is Don Lancaster ...

I know, I have seen his site.

The PostScript graphics model has long been superseded by worthy
successors, like Cairo. I did my own Python binding for Cairo
<https://gitlab.com/ldo/qahirah>, which adds things like vectors, matrices
and colours as first-class objects--beyond what Cairo itself, as a C-
language-based library, can do.

What I am interested in here is the PostScript language itself, and how it
can be modernized.

Subject: Re: On Stack-Based Languages (was Re: on Perl)
From: Anssi Saari
Newsgroups: comp.unix.programmer, comp.lang.misc
Organization: An impatient and LOUD arachnid
Date: Thu, 18 Apr 2024 12:00 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anssi.saari@usenet.mail.kapsi.fi (Anssi Saari)
Newsgroups: comp.unix.programmer,comp.lang.misc
Subject: Re: On Stack-Based Languages (was Re: on Perl)
Date: Thu, 18 Apr 2024 15:00:20 +0300
Organization: An impatient and LOUD arachnid
Lines: 12
Message-ID: <sm04jbyhodn.fsf@lakka.kapsi.fi>
References: <uu54la$3su5b$6@dont-email.me> <87edbtz43p.fsf@tudado.org>
<0d2cnVzOmbD6f4z7nZ2dnZfqnPudnZ2d@brightview.co.uk>
<20240408075547.000061e8@gmail.com>
<g52cnWOOwoz_son7nZ2dnZfqnPWdnZ2d@brightview.co.uk>
<uvbe3m$2cun7$1@dont-email.me>
<Mkidnafag8vlooH7nZ2dnZfqn_idnZ2d@brightview.co.uk>
<pan$c8c3e$b0e492b3$c544c27e$d72bff90@invalid.invalid>
<uvk8o6$h2pg$3@dont-email.me> <20240415152951.000079ab@gmail.com>
<uvkbec$hjeq$1@dont-email.me> <uvlc1f$rgng$1@dont-email.me>
<slrnv1smf9.25p4.naddy@lorvorc.mips.inka.de>
<uvlp8g$u62e$1@dont-email.me> <87wmowv9fy.fsf@eder.anydns.info>
<20240417080523.00005e99@gmail.com> <uvqjlu$257pa$1@dont-email.me>
<uvqm4r$25k0u$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Thu, 18 Apr 2024 14:00:22 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="881a967cd01cef3e6ad046fc0c71349a";
logging-data="2366472"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196eLduDGBYlbELRpTgnx5P"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:7XHZfBo/91ec2/d/xWwFpghTGZs=
sha1:nuZNHf5fWJYFRvRIabfQcKOLOh4=
View all headers

David Brown <david.brown@hesbynett.no> writes:

> I think I have only ever heard of one person who actually uses
> PostScript for programming by hand, rather than as a print output
> format.

I think I got a postscript program from Usenet or somewhere to print CD
covers once upon a time. Never used it though. I think the idea was to
edit track and artist names directly into the code and send it to a
printer.

The author may have been Jamie Zawinski but I'm not sure.

Subject: Re: On Stack-Based Languages (was Re: on Perl)
From: James K. Lowden
Newsgroups: comp.unix.programmer, comp.lang.misc
Organization: NewsDemon - www.newsdemon.com
Date: Fri, 19 Apr 2024 14:16 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Date: Fri, 19 Apr 2024 14:16:28 +0000
From: jklowden@speakeasy.net (James K. Lowden)
Newsgroups: comp.unix.programmer,comp.lang.misc
Subject: Re: On Stack-Based Languages (was Re: on Perl)
Message-Id: <20240418120336.e1ccfcd857488a359614b54b@speakeasy.net>
References: <uu54la$3su5b$6@dont-email.me> <87edbtz43p.fsf@tudado.org> <0d2cnVzOmbD6f4z7nZ2dnZfqnPudnZ2d@brightview.co.uk> <20240408075547.000061e8@gmail.com> <g52cnWOOwoz_son7nZ2dnZfqnPWdnZ2d@brightview.co.uk> <uvbe3m$2cun7$1@dont-email.me> <Mkidnafag8vlooH7nZ2dnZfqn_idnZ2d@brightview.co.uk> <pan$c8c3e$b0e492b3$c544c27e$d72bff90@invalid.invalid> <uvk8o6$h2pg$3@dont-email.me> <20240415152951.000079ab@gmail.com> <uvkbec$hjeq$1@dont-email.me> <uvlc1f$rgng$1@dont-email.me> <slrnv1smf9.25p4.naddy@lorvorc.mips.inka.de> <uvlp8g$u62e$1@dont-email.me> <87wmowv9fy.fsf@eder.anydns.info> <20240417080523.00005e99@gmail.com> <uvqjlu$257pa$1@dont-email.me> <uvqm4r$25k0u$3@dont-email.me> <uvqmhs$25pds$3@dont-email.me>
X-Newsreader: Sylpheed 3.4.3 (GTK+ 2.24.28; x86_64--netbsd)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Lines: 11
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!news.newsdemon.com!not-for-mail
Nntp-Posting-Date: Fri, 19 Apr 2024 14:16:28 +0000
X-Received-Bytes: 1631
Organization: NewsDemon - www.newsdemon.com
X-Complaints-To: abuse@newsdemon.com
View all headers

On Thu, 18 Apr 2024 08:44:44 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:

> The PostScript graphics model has long been superseded by worthy
> successors, like Cairo.

Yes and no. I believe Keith Packard describes Cairo as PostScript
without the syntax: it shares the same page-display model, but is
presented as a set of C functions instead of a language.

--jkl

Subject: Re: On Stack-Based Languages (was Re: on Perl)
From: Lawrence D'Oliv
Newsgroups: comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Fri, 19 Apr 2024 21:57 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer,comp.lang.misc
Subject: Re: On Stack-Based Languages (was Re: on Perl)
Date: Fri, 19 Apr 2024 21:57:53 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <uvupd1$37f8s$3@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <87edbtz43p.fsf@tudado.org>
<0d2cnVzOmbD6f4z7nZ2dnZfqnPudnZ2d@brightview.co.uk>
<20240408075547.000061e8@gmail.com>
<g52cnWOOwoz_son7nZ2dnZfqnPWdnZ2d@brightview.co.uk>
<uvbe3m$2cun7$1@dont-email.me>
<Mkidnafag8vlooH7nZ2dnZfqn_idnZ2d@brightview.co.uk>
<pan$c8c3e$b0e492b3$c544c27e$d72bff90@invalid.invalid>
<uvk8o6$h2pg$3@dont-email.me> <20240415152951.000079ab@gmail.com>
<uvkbec$hjeq$1@dont-email.me> <uvlc1f$rgng$1@dont-email.me>
<slrnv1smf9.25p4.naddy@lorvorc.mips.inka.de> <uvlp8g$u62e$1@dont-email.me>
<87wmowv9fy.fsf@eder.anydns.info> <20240417080523.00005e99@gmail.com>
<uvqjlu$257pa$1@dont-email.me> <uvqm4r$25k0u$3@dont-email.me>
<uvqmhs$25pds$3@dont-email.me>
<20240418120336.e1ccfcd857488a359614b54b@speakeasy.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 19 Apr 2024 23:57:54 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="9edfee33d4561201a41a00d87dc9eb08";
logging-data="3390748"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18EsZ84orZn9dqtXoUd+y67"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:RAWkDI/ChmfpfChGqqsMMDvEtZo=
View all headers

On Fri, 19 Apr 2024 14:16:28 +0000, James K. Lowden wrote:

> I believe Keith Packard describes Cairo as PostScript
> without the syntax ...

The PostScript graphics model (even Display PostScript) never progressed
beyond the concept of putting marks on paper.

While Cairo is clearly inspired by PostScript, it is also clearly an
improvement on it, adding features specifically to support interactive
graphics on a display screen, like operators and alpha channels. It also
has better Unicode support.

1

rocksolid light 0.9.8
clearnet tor