Deutsch   English   Français   Italiano  
<2025Mar12.095719@mips.complang.tuwien.ac.at>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: Why VAX Was the Ultimate CISC and Not RISC
Date: Wed, 12 Mar 2025 08:57:19 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 52
Message-ID: <2025Mar12.095719@mips.complang.tuwien.ac.at>
References: <vpufbv$4qc5$1@dont-email.me> <vqfmr4$3npgk$1@dont-email.me> <vqg04o$3p80h$1@dont-email.me> <vqgbao$3rbkh$1@dont-email.me> <9371fe9be75cdd606c876f539e1d2d78@www.novabbs.org> <vqnps4$1j63b$1@dont-email.me> <0da86de26bac1912b190793512255aa4@www.novabbs.org> <vqo8b1$1ln7o$1@dont-email.me> <vqokel$1rcu2$1@dont-email.me> <d9ca952fdc4a6cb667ed15515f97996e@www.novabbs.org> <IW1AP.458544$2zn8.26913@fx15.iad> <vqqamt$26g0n$1@dont-email.me> <vqqe4j$273mt$1@dont-email.me>
Injection-Date: Wed, 12 Mar 2025 10:06:55 +0100 (CET)
Injection-Info: dont-email.me; posting-host="e153970a2f02b13d8544fa3a32e66bd4";
	logging-data="2659219"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX185z90jA5UnrMu/vAUGZYmJ"
Cancel-Lock: sha1:qwM5T6SXiRQpvMTqUq04p6mhR1o=
X-newsreader: xrn 10.11
Bytes: 2732

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>One of the early programming languages I came across was POP-2. This was 
>fully dynamic and heap-based, like Lisp, but also had an operand stack. So 
>a simple assignment statement looked like
>
>    a -> b;
>
>but this could actually be written as two separate statements:
>
>    a;
>    -> b;
>
>The first one pushed the value of a on the stack, the second one popped it 
>off and stored it in b.
>
>This made it easy to do things like swap variable values:
>
>    a, b -> a -> b;

In Forth you can define VALUEs that work like these POP-11 variables.
In standard Forth you can write

3 value a
5 value b
a b to a to b \ swaps the contents of a and b
a . b . \ print a and b

In some Forth systems you can write it in a syntax even closer to that
of POP:

On VFX Forth you can write:

a b -> a -> b

In Gforth (development version) you can write

a b ->a ->b

That's all not very idiomatic, though.  VARIABLEs (which push their
address rather than their value) are more popular than VALUEs, but
usage such as the following is also not idiomatic; you usually use
variables (and values) sparingly.

variable a 3 a !
variable b 5 b !
a @ b @ a ! b !
a @ . b @ .

- anton
-- 
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
  Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>