Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Thank heaven for startups; without them we'd never have any advances." -- Seymour Cray


devel / comp.lang.misc / Re: "modals" in Algol68

SubjectAuthor
* "modals" in Algol68Bakul Shah
`* Re: "modals" in Algol68Andy Walker
 `* Re: "modals" in Algol68Bakul Shah
  `* Re: "modals" in Algol68Charles Lindsey
   `- Re: "modals" in Algol68Bakul Shah

1
"modals" in Algol68

<spt78r$7he$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1632&group=comp.lang.misc#1632

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bakul@iitbombay.org (Bakul Shah)
Newsgroups: comp.lang.misc
Subject: "modals" in Algol68
Date: Tue, 21 Dec 2021 10:43:37 -0800
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <spt78r$7he$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 21 Dec 2021 18:43:39 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="52dad98cd32ca72964b597eef097dbe7";
logging-data="7726"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Wi5TTdGC/nO6KcN1L1qIK"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:68.0)
Gecko/20100101 Firefox/68.0 SeaMonkey/2.53.10.1
Cancel-Lock: sha1:WGelzED4CQ1+Kmsh2XroprsTER8=
X-Mozilla-News-Host: snews://news.eternal-september.org:563
 by: Bakul Shah - Tue, 21 Dec 2021 18:43 UTC

Q for the Algol68 experts/historians on this group:

Looking at C.H.Lindsey's "Modals" in
https://archive.computerhistory.org/resources/text/algol/algol_bulletin/A37/P43.HTM

It seems this is basically describing generic types and functions.
For example,

MODE LINK = (MODE X) STRUCT ( REF X name, REF LINK(X) next);

So LINK is a modal while LINK(INT) would be a mode, right?

Was this ever implemented or considered seriously for one?
How would have they handled operations on variables of such
mode? That is, if a function body uses, for example, +, then
only modes that have + defined on them can be used as a mode
"parameter". In particular comparison operators would be
needed for a generic sort procedure!

Just curious.

Re: "modals" in Algol68

<sptghf$ibb$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1633&group=comp.lang.misc#1633

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!aioe.org!7y76kKd3l4miSXwPE6o/0A.user.46.165.242.75.POSTED!not-for-mail
From: anw@cuboid.co.uk (Andy Walker)
Newsgroups: comp.lang.misc
Subject: Re: "modals" in Algol68
Date: Tue, 21 Dec 2021 21:21:51 +0000
Organization: Not very much
Message-ID: <sptghf$ibb$1@gioia.aioe.org>
References: <spt78r$7he$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="18795"; posting-host="7y76kKd3l4miSXwPE6o/0A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: Andy Walker - Tue, 21 Dec 2021 21:21 UTC

On 21/12/2021 18:43, Bakul Shah wrote:
> Looking at C.H.Lindsey's "Modals" in
> https://archive.computerhistory.org/resources/text/algol/algol_bulletin/A37/P43.HTM
> It seems this is basically describing generic types and functions.
> For example,
> MODE LINK = (MODE X) STRUCT ( REF X name, REF LINK(X) next);
> So LINK is a modal while LINK(INT) would be a mode, right?

That's my understanding [but based almost entirely on the
article you mention].

> Was this ever implemented or considered seriously for one?

As Charles says, it is believed to have been implemented
in Mary. I don't have the Mary book, and Wiki is silent on the
matter. I "invited" Marcel to implement it for A68G, but he
didn't bite; I didn't push him as to whether this was because it
was too difficult, or too uninteresting [to him]. So, AFAIK, it
has never been implemented in an A68 dialect. Charles may well
know more.

> How would have they handled operations on variables of such
> mode? That is, if a function body uses, for example, +, then
> only modes that have + defined on them can be used as a mode
> "parameter". In particular comparison operators would be
> needed for a generic sort procedure!

Note that the modal is only ever used as a reference.
So you can implement generic queues and similar, but [as per
the example in AB] a generic sort procedure needs a handler
routine to do the comparisons. IOW, it's quite a limited
facility, but "interesting" and occasionally useful. As
noted in Charles's paper, the limitations need exploration;
I'm not aware of any more advanced proposal. For the AB
proposal, you have to imagine that any code using a modal
has been pre-compiled, and so knows nothing about how it is
to be used in your program. That seems to resolve most
questions. [The point about references is that, in most
implementations, the compiler may have no idea how big an
array or a structure will be (in code yet to be written),
but it's likely that it knows how big a pointer to them
will be, so that's what can be compiled.]

--
Andy Walker, Nottingham.
Andy's music pages: www.cuboid.me.uk/andy/Music
Composer of the day: www.cuboid.me.uk/andy/Music/Composers/Ravel

Re: "modals" in Algol68

<sptmm8$pjc$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1634&group=comp.lang.misc#1634

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bakul@iitbombay.org (Bakul Shah)
Newsgroups: comp.lang.misc
Subject: Re: "modals" in Algol68
Date: Tue, 21 Dec 2021 15:06:46 -0800
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <sptmm8$pjc$1@dont-email.me>
References: <spt78r$7he$1@dont-email.me> <sptghf$ibb$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 21 Dec 2021 23:06:48 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="2db08d44eff907fb1b8e096617477b57";
logging-data="26220"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+5h5RMs8m85Ua16BRKfQjx"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:68.0)
Gecko/20100101 Firefox/68.0 SeaMonkey/2.53.10.1
Cancel-Lock: sha1:hRJz8VHloS70HP2gqA9KGib3gmY=
In-Reply-To: <sptghf$ibb$1@gioia.aioe.org>
 by: Bakul Shah - Tue, 21 Dec 2021 23:06 UTC

On 12/21/21 1:21 PM, Andy Walker wrote:
> On 21/12/2021 18:43, Bakul Shah wrote:
>> Looking at C.H.Lindsey's "Modals" in
>> https://archive.computerhistory.org/resources/text/algol/algol_bulletin/A37/P43.HTM
>> It seems this is basically describing generic types and functions.
>> For example,
>> MODE LINK = (MODE X) STRUCT ( REF X name, REF LINK(X) next);
>> So LINK is a modal while LINK(INT) would be a mode, right?
>
>     That's my understanding [but based almost entirely on the
> article you mention].
>
>> Was this ever implemented or considered seriously for one?
>
>     As Charles says, it is believed to have been implemented
> in Mary.  I don't have the Mary book, and Wiki is silent on the
> matter.  I "invited" Marcel to implement it for A68G, but he
> didn't bite;  I didn't push him as to whether this was because it
> was too difficult, or too uninteresting [to him].  So, AFAIK, it
> has never been implemented in an A68 dialect.  Charles may well
> know more.

Thanks! As it happens, a few years ago I came to know one of the
people involved in the Mary language design so I have asked him.

>> How would have they handled operations on variables of such
>> mode? That is, if a function body uses, for example, +, then
>> only modes that have + defined on them can be used as a mode
>> "parameter". In particular comparison operators would be
>> needed for a generic sort procedure!
>
>     Note that the modal is only ever used as a reference.
> So you can implement generic queues and similar, but [as per
> the example in AB] a generic sort procedure needs a handler
> routine to do the comparisons.  IOW, it's quite a limited
> facility, but "interesting" and occasionally useful.  As
> noted in Charles's paper, the limitations need exploration;
> I'm not aware of any more advanced proposal.  For the AB
> proposal, you have to imagine that any code using a modal
> has been pre-compiled, and so knows nothing about how it is
> to be used in your program.  That seems to resolve most
> questions.  [The point about references is that, in most
> implementations, the compiler may have no idea how big an
> array or a structure will be (in code yet to be written),
> but it's likely that it knows how big a pointer to them
> will be, so that's what can be compiled.]

I believe you can do do this at compile time (think proper
macros) but you'd need the source of the generic library.
The compiler would have to store the requirements somehow
so that it can provide an error message at the use site,
in case of passing the wrong type to a generic type/function.
Or the language can provide a way to indicate this.

Re: "modals" in Algol68

<j2gtgoFac5eU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1636&group=comp.lang.misc#1636

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: chl@clerew.man.ac.uk (Charles Lindsey)
Newsgroups: comp.lang.misc
Subject: Re: "modals" in Algol68
Date: Wed, 22 Dec 2021 15:11:19 +0000
Lines: 47
Message-ID: <j2gtgoFac5eU1@mid.individual.net>
References: <spt78r$7he$1@dont-email.me> <sptghf$ibb$1@gioia.aioe.org>
<sptmm8$pjc$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net F0UUbZQf1vktS1PCN7z6AQW5OXXgP/EEt35kk6eKzpAzdi0v8=
Cancel-Lock: sha1:0J0dRb4cjag/sM5/51syAsFMwws=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
In-Reply-To: <sptmm8$pjc$1@dont-email.me>
Content-Language: en-US
 by: Charles Lindsey - Wed, 22 Dec 2021 15:11 UTC

On 21/12/2021 23:06, Bakul Shah wrote:
> On 12/21/21 1:21 PM, Andy Walker wrote:
>> On 21/12/2021 18:43, Bakul Shah wrote:
>>> Looking at C.H.Lindsey's "Modals" in
>>> https://archive.computerhistory.org/resources/text/algol/algol_bulletin/A37/P43.HTM
>>> It seems this is basically describing generic types and functions.
>>> For example,
>>> MODE LINK = (MODE X) STRUCT ( REF X name, REF LINK(X) next);
>>> So LINK is a modal while LINK(INT) would be a mode, right?
>>
>>      That's my understanding [but based almost entirely on the
>> article you mention].
>>
>>> Was this ever implemented or considered seriously for one?
>>
>>      As Charles says, it is believed to have been implemented
>> in Mary.  I don't have the Mary book, and Wiki is silent on the
>> matter.  I "invited" Marcel to implement it for A68G, but he
>> didn't bite;  I didn't push him as to whether this was because it
>> was too difficult, or too uninteresting [to him].  So, AFAIK, it
>> has never been implemented in an A68 dialect.  Charles may well
>> know more.

No, I have heard or done nothing concerning modals since the paper was written,
and the posts in this thread have already covered most of the issues.
Essentially modals in Algol 68 are equivalent to templates in C++, which we have
discussed here several times.

I had the Mary book at one time, but if you want to read it you will have to go
to California since all my papers have been donated to the Computer History Museum.
>
> Thanks! As it happens, a few years ago I came to know one of the
> people involved in the Mary language design so I have asked him.

Was that Mark Rains? Let us know if anything comes back from that source.

My chief memory of Mark Rains is his very quotable remark:

"Algol 68 is Complex;
PL/1 is Complicated."

--
Charles H. Lindsey ---------At my New Home, still doing my own thing------
Tel: +44 161 488 1845 Web: https://www.clerew.man.ac.uk
Email: chl@clerew.man.ac.uk Snail-mail: Apt 40, SK8 5BF, U.K.
PGP: 2C15F1A9 Fingerprint: 73 6D C2 51 93 A0 01 E7 65 E8 64 7E 14 A4 AB A5

Re: "modals" in Algol68

<spvim5$kbu$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1638&group=comp.lang.misc#1638

  copy link   Newsgroups: comp.lang.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bakul@iitbombay.org (Bakul Shah)
Newsgroups: comp.lang.misc
Subject: Re: "modals" in Algol68
Date: Wed, 22 Dec 2021 08:10:43 -0800
Organization: A noiseless patient Spider
Lines: 69
Message-ID: <spvim5$kbu$1@dont-email.me>
References: <spt78r$7he$1@dont-email.me> <sptghf$ibb$1@gioia.aioe.org>
<sptmm8$pjc$1@dont-email.me> <j2gtgoFac5eU1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 22 Dec 2021 16:10:45 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="2db08d44eff907fb1b8e096617477b57";
logging-data="20862"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/ykLC7bDCWsq7cLJInTxE"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:68.0)
Gecko/20100101 Firefox/68.0 SeaMonkey/2.53.10.1
Cancel-Lock: sha1:ab98N0nv1b9NqDAvdDGz2fO5GZU=
In-Reply-To: <j2gtgoFac5eU1@mid.individual.net>
 by: Bakul Shah - Wed, 22 Dec 2021 16:10 UTC

On 12/22/21 7:11 AM, Charles Lindsey wrote:
> On 21/12/2021 23:06, Bakul Shah wrote:
>> On 12/21/21 1:21 PM, Andy Walker wrote:
>>> On 21/12/2021 18:43, Bakul Shah wrote:
>>>> Looking at C.H.Lindsey's "Modals" in
>>>> https://archive.computerhistory.org/resources/text/algol/algol_bulletin/A37/P43.HTM
>>>> It seems this is basically describing generic types and functions.
>>>> For example,
>>>> MODE LINK = (MODE X) STRUCT ( REF X name, REF LINK(X) next);
>>>> So LINK is a modal while LINK(INT) would be a mode, right?
>>>
>>>      That's my understanding [but based almost entirely on the
>>> article you mention].
>>>
>>>> Was this ever implemented or considered seriously for one?
>>>
>>>      As Charles says, it is believed to have been implemented
>>> in Mary.  I don't have the Mary book, and Wiki is silent on the
>>> matter.  I "invited" Marcel to implement it for A68G, but he
>>> didn't bite;  I didn't push him as to whether this was because it
>>> was too difficult, or too uninteresting [to him].  So, AFAIK, it
>>> has never been implemented in an A68 dialect.  Charles may well
>>> know more.
>
> No, I have heard or done nothing concerning modals since the paper was
> written, and the posts in this thread have already covered most of the
> issues. Essentially modals in Algol 68 are equivalent to templates in
> C++, which we have discussed here several times.

Thanks.

> I had the Mary book at one time, but if you want to read it you will
> have to go to California since all my papers have been donated to the
> Computer History Museum.

CHM is about 5 miles from my home, though temporarily closed due to
the coronavirus. At CHM online I did find Mark Rains' paper on "Some
formal aspects of MARY or Algol X revisited" which seems to explain
its differences from Algol68.

>>
>> Thanks! As it happens, a few years ago I came to know one of the
>> people involved in the Mary language design so I have asked him.
>
> Was that Mark Rains? Let us know if anything comes back from that source.

Yes, indeed. Now known as Ivan Godard. He has been working on a new
& very interesting processor architecture called Mill for the past many
years. He occasionally posts on comp.arch.

He did respond. In part he said "Modals were declarable LL1 syntax with
value name binding for the runtime arguments; you passed a pointer or
thunk for other kinds of binding. Because both types and syntax could
be arguments too, modals were both weaker and stronger than C++
templates. There was no automatic partial parameterization. Coercions
could be chained arbitrarily to achieve a desired type. Coercions were
declarable; all contexts were fixed by the language."

> My chief memory of Mark Rains is his very quotable remark:
>
>    "Algol 68 is Complex;
>     PL/1 is Complicated."

Funny, sad & true! I never had a chance to use A68 but at one point
I knew PL/I pretty well.

Thanks for your response!

Bakul

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor