Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"You can't make a program without broken egos."


devel / comp.arch / Re: Secrets of the ancients, What the World Needs Now

SubjectAuthor
* What the World Needs NowQuadibloc
+* Re: What the World Needs NowMitchAlsup
|+* Re: What the World Needs NowQuadibloc
||+- Re: What the World Needs NowScott Lurndal
||+* Re: What the World Needs NowMitchAlsup
|||`* Re: What the World Needs NowQuadibloc
||| `- Re: What the World Needs NowQuadibloc
||`- Re: What the World Needs NowQuadibloc
|`* Re: What the World Needs NowEricP
| +- Re: What the World Needs NowBGB
| `* Re: What the World Needs NowQuadibloc
|  +* Re: What the World Needs NowEricP
|  |`* Re: What the World Needs NowQuadibloc
|  | +* Re: What the World Needs NowMitchAlsup
|  | |`- Re: What the World Needs NowQuadibloc
|  | `* Re: What the World Needs NowEricP
|  |  +* Re: What the World Needs NowThomas Koenig
|  |  |+- Re: What the World Needs NowMitchAlsup
|  |  |`- Re: What the World Needs NowScott Lurndal
|  |  +- Re: What the World Needs NowQuadibloc
|  |  `* Re: What the World Needs NowBGB
|  |   `* Re: What the World Needs NowEricP
|  |    +- Re: What the World Needs NowBGB
|  |    `* Re: What the World Needs NowMitchAlsup
|  |     `* Re: What the World Needs NowEricP
|  |      +* Re: What the World Needs NowMitchAlsup
|  |      |`* Re: What the World Needs NowEricP
|  |      | `* Re: What the World Needs NowMitchAlsup
|  |      |  `- Re: What the World Needs NowScott Lurndal
|  |      `* Re: What the World Needs NowScott Lurndal
|  |       `- Re: What the World Needs NowMitchAlsup
|  `* Re: What the World Needs NowAnton Ertl
|   `* Re: What the World Needs NowQuadibloc
|    +* Re: What the World Needs NowQuadibloc
|    |+- Re: What the World Needs NowQuadibloc
|    |`- Re: What the World Needs NowAnton Ertl
|    +* Re: What the World Needs NowAnton Ertl
|    |+* Re: What the World Needs NowQuadibloc
|    ||`- Re: What the World Needs NowAnton Ertl
|    |`* Re: What the World Needs NowScott Lurndal
|    | `- Re: What the World Needs NowQuadibloc
|    `* Re: What the World Needs NowAnton Ertl
|     `* Re: What the World Needs NowThomas Koenig
|      +- Re: What the World Needs NowAnton Ertl
|      `* Re: Secrets of the ancients, What the World Needs NowJohn Levine
|       `* Re: Secrets of the ancients, What the World Needs NowThomas Koenig
|        `* Re: Secrets of the ancients, What the World Needs NowJohn Levine
|         `* Re: Secrets of the ancients, What the World Needs NowThomas Koenig
|          +* Re: Secrets of the ancients, What the World Needs NowJohn Levine
|          |`* Re: Secrets of the ancients, What the World Needs NowScott Lurndal
|          | `* Re: Secrets of the ancients, What the World Needs NowJohn Levine
|          |  `- Re: Secrets of the ancients, What the World Needs NowMitchAlsup
|          `* Re: Secrets of the ancients, What the World Needs NowNiklas Holsti
|           `* Re: Secrets of the ancients, What the World Needs NowAnton Ertl
|            `* Re: Secrets of the ancients, What the World Needs NowNiklas Holsti
|             +* Re: Secrets of the ancients, What the World Needs NowThomas Koenig
|             |+* Re: Secrets of the ancients, What the World Needs NowMitchAlsup
|             ||`* Re: Secrets of the ancients, What the World Needs NowNiklas Holsti
|             || +- Re: Secrets of the ancients, What the World Needs NowMitchAlsup
|             || `* Re: Secrets of the ancients, What the World Needs NowTerje Mathisen
|             ||  `- Re: Secrets of the ancients, What the World Needs NowNiklas Holsti
|             |`- Re: Secrets of the ancients, What the World Needs NowNiklas Holsti
|             +* Re: Secrets of the ancients, What the World Needs NowDavid Brown
|             |`* Re: Secrets of the ancients, What the World Needs NowStephen Fuld
|             | `* Re: Secrets of the ancients, What the World Needs NowAnton Ertl
|             |  +* Re: Secrets of the ancients, What the World Needs NowMitchAlsup
|             |  |+* Re: Secrets of the ancients, What the World Needs NowAnton Ertl
|             |  ||`* Nested functions and representation of closures (was: Secrets of the ancients, WStefan Monnier
|             |  || +* Re: Nested functions and representation of closuresDavid Brown
|             |  || |+* Re: Nested functions and representation of closuresThomas Koenig
|             |  || ||`* Re: Nested functions and representation of closuresEricP
|             |  || || `* Re: Nested functions and representation of closuresMitchAlsup
|             |  || ||  `- Re: Nested functions and representation of closuresEricP
|             |  || |`* Re: Nested functions and representation of closuresMichael S
|             |  || | `- Re: Nested functions and representation of closuresDavid Brown
|             |  || `* Re: Nested functions and representation of closures (was: Secrets of the ancientAnton Ertl
|             |  ||  `- Re: Nested functions and representation of closuresBGB
|             |  |+- Re: Secrets of the ancients, What the World Needs NowGeorge Neuner
|             |  |`- Re: Secrets of the ancients, What the World Needs NowJean-Marc Bourguet
|             |  `* Re: Secrets of the ancients, What the World Needs NowTim Rentsch
|             |   `* Re: Secrets of the ancients, What the World Needs NowMitchAlsup
|             |    +* Re: Secrets of the ancients, What the World Needs NowJohn Levine
|             |    |+- Re: Secrets of the ancients, What the World Needs NowMitchAlsup
|             |    |`* Re: Secrets of the ancients, What the World Needs NowAnton Ertl
|             |    | `- Re: Secrets of the ancients, What the World Needs NowGeorge Neuner
|             |    `- Re: Secrets of the ancients, What the World Needs NowTim Rentsch
|             `- Re: Secrets of the ancients, What the World Needs NowThomas Koenig
`* Re: What the World Needs NowQuadibloc
 `* Re: What the World Needs NowQuadibloc
  `- Re: What the World Needs NowQuadibloc

Pages:1234
Re: Secrets of the ancients, What the World Needs Now

<uln60k$2m9s$1@gal.iecc.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35830&group=comp.arch#35830

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!not-for-mail
From: johnl@taugh.com (John Levine)
Newsgroups: comp.arch
Subject: Re: Secrets of the ancients, What the World Needs Now
Date: Sun, 17 Dec 2023 16:01:24 -0000 (UTC)
Organization: Taughannock Networks
Message-ID: <uln60k$2m9s$1@gal.iecc.com>
References: <uletbu$19ohv$1@dont-email.me> <ulldia$2jkgh$2@dont-email.me> <2023Dec17.094139@mips.complang.tuwien.ac.at> <ulml73$10fu3$1@newsreader4.netcologne.de>
Injection-Date: Sun, 17 Dec 2023 16:01:24 -0000 (UTC)
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970";
logging-data="88380"; mail-complaints-to="abuse@iecc.com"
In-Reply-To: <uletbu$19ohv$1@dont-email.me> <ulldia$2jkgh$2@dont-email.me> <2023Dec17.094139@mips.complang.tuwien.ac.at> <ulml73$10fu3$1@newsreader4.netcologne.de>
Cleverness: some
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: johnl@iecc.com (John Levine)
 by: John Levine - Sun, 17 Dec 2023 16:01 UTC

According to Thomas Koenig <tkoenig@netcologne.de>:
>So, an open question: How does one create a pointer to a nested
>function in architectures which disallow rwx pages?

You make pointers two words, one for the code, one that points to the
display for the dynamic data. This has been a standard compiler
technique since the late 1960s, and indeed the GCC page you pointed to
calls them descriptors. In the fine tradition of GCC overimplmenting
everything, they set bits in descriptors to deliberately misalign them
and indirect calls check to see how much indirection to do.

For a particularly painful example of nested functions, see Knuth's Man or Boy test

https://rosettacode.org/wiki/Man_or_boy_test

--
Regards,
John Levine, johnl@taugh.com, Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail. https://jl.ly

Re: Secrets of the ancients, What the World Needs Now

<uln86f$10rpl$1@newsreader4.netcologne.de>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35831&group=comp.arch#35831

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-dd23-0-b3b7-1409-c8d9-539f.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Secrets of the ancients, What the World Needs Now
Date: Sun, 17 Dec 2023 16:38:39 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <uln86f$10rpl$1@newsreader4.netcologne.de>
References: <uletbu$19ohv$1@dont-email.me> <ulldia$2jkgh$2@dont-email.me>
<2023Dec17.094139@mips.complang.tuwien.ac.at>
<ulml73$10fu3$1@newsreader4.netcologne.de> <uln60k$2m9s$1@gal.iecc.com>
Injection-Date: Sun, 17 Dec 2023 16:38:39 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-dd23-0-b3b7-1409-c8d9-539f.ipv6dyn.netcologne.de:2001:4dd7:dd23:0:b3b7:1409:c8d9:539f";
logging-data="1077045"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Sun, 17 Dec 2023 16:38 UTC

John Levine <johnl@taugh.com> schrieb:
> According to Thomas Koenig <tkoenig@netcologne.de>:
>>So, an open question: How does one create a pointer to a nested
>>function in architectures which disallow rwx pages?
>
> You make pointers two words, one for the code, one that points to the
> display for the dynamic data. This has been a standard compiler
> technique since the late 1960s, and indeed the GCC page you pointed to
> calls them descriptors. In the fine tradition of GCC overimplmenting
> everything, they set bits in descriptors to deliberately misalign them
> and indirect calls check to see how much indirection to do.

.... which is yields ABI problems if the ABI is modeled on C,
and on function pointers being convertible to void* and back),
and needs requires conditional code for _each_ call through a
function pointer, because it needs to check if it is a vanilla
call or a call to a nested function.

> For a particularly painful example of nested functions, see Knuth's Man or Boy test
>
> https://rosettacode.org/wiki/Man_or_boy_test

Yes, that one is quite challenging.

Re: What the World Needs Now

<PuFfN.53323$p%Mb.32922@fx15.iad>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35832&group=comp.arch#35832

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!newsfeed.endofthelinebbs.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx15.iad.POSTED!not-for-mail
From: ThatWouldBeTelling@thevillage.com (EricP)
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
Newsgroups: comp.arch
Subject: Re: What the World Needs Now
References: <uletbu$19ohv$1@dont-email.me> <5c7dd089ac74ea85a07413b08347a333@news.novabbs.com> <ALZeN.1985$U1cc.561@fx04.iad> <ulkine$2fi18$1@dont-email.me> <sDkfN.51804$Wp_8.32752@fx17.iad> <ulld29$2jkgh$1@dont-email.me>
In-Reply-To: <ulld29$2jkgh$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 43
Message-ID: <PuFfN.53323$p%Mb.32922@fx15.iad>
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Sun, 17 Dec 2023 16:39:11 UTC
Date: Sun, 17 Dec 2023 11:38:43 -0500
X-Received-Bytes: 2611
 by: EricP - Sun, 17 Dec 2023 16:38 UTC

Quadibloc wrote:
> On Sat, 16 Dec 2023 11:54:40 -0500, EricP wrote:
>> Quadibloc wrote:
>
>>> Here, making it so that once access to write plus execute is turned
>>> off,
>>> it can't be turned on again without a reboot seems appropriate. (Or
>>> "potentially on", because forcing the system to boot with this enabled
>>> isn't a good idea either. So there would be three states: RWE
>>> available,
>>> but off; RWE on; RWE turned permanently off until reboot. From the
>>> third state, there is no return to the first two.)
>
>> Did you take a course in customer abusive design or something?
>> Who is it you think you are going to sell this feature to?
>
> Well, Mitch proposes making it completely and absolutely impossible
> for memory to both contain code that can currently be executed, and
> for it to be writeable, at the same time.
>
> I recognized the logic behind this. Yet, there are cases when this
> would be a problem. So I felt that an option might be to dial the
> security just a tiny notch down:
>
> Make it _possible_ to have an operating system that did allow
> read and execute at the same time, but _also_ make it possible for
> an operating system not to allow it - in a way that can't be
> subverted. The only way to change that being disabled is to reboot
> into a different operating system that does allow it.
>
> John Savard
>

I'm objecting to the notion of forcing a processor to reboot
for any reason, let alone in order to change something that is
under control of the operating system. There was a time before PC's
when computers normally ran for a year without reboot and never crashed.

As for Mitch's RW-no-E restriction, I am confident it
will not survive its first encounter with actual customers
(where philosophy collides with income).

Re: What the World Needs Now

<ulnddo$110em$2@newsreader4.netcologne.de>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35835&group=comp.arch#35835

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-dd23-0-b3b7-1409-c8d9-539f.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: What the World Needs Now
Date: Sun, 17 Dec 2023 18:07:52 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <ulnddo$110em$2@newsreader4.netcologne.de>
References: <uletbu$19ohv$1@dont-email.me>
<5c7dd089ac74ea85a07413b08347a333@news.novabbs.com>
<ALZeN.1985$U1cc.561@fx04.iad> <ulkine$2fi18$1@dont-email.me>
<sDkfN.51804$Wp_8.32752@fx17.iad> <ulld29$2jkgh$1@dont-email.me>
<PuFfN.53323$p%Mb.32922@fx15.iad>
Injection-Date: Sun, 17 Dec 2023 18:07:52 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-dd23-0-b3b7-1409-c8d9-539f.ipv6dyn.netcologne.de:2001:4dd7:dd23:0:b3b7:1409:c8d9:539f";
logging-data="1081814"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Sun, 17 Dec 2023 18:07 UTC

EricP <ThatWouldBeTelling@thevillage.com> schrieb:

> I'm objecting to the notion of forcing a processor to reboot
> for any reason, let alone in order to change something that is
> under control of the operating system. There was a time before PC's
> when computers normally ran for a year without reboot and never crashed.

[tkoenig@cfarm135 ~]$ uptime
18:03:12 up 1537 days, 19:33, 1 user, load average: 12,31, 9,59, 8,58
[tkoenig@cfarm135 ~]$ uname -a
Linux cfarm135 4.18.0-80.7.2.el7.ppc64le #1 SMP Thu Sep 12 15:45:05 UTC 2019 ppc64le ppc64le ppc64le GNU/Linux

Re: What the World Needs Now

<d28b5fed0cd944aa67e712c07b2fc6a4@news.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35837&group=comp.arch#35837

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup)
Newsgroups: comp.arch
Subject: Re: What the World Needs Now
Date: Sun, 17 Dec 2023 18:24:52 +0000
Organization: novaBBS
Message-ID: <d28b5fed0cd944aa67e712c07b2fc6a4@news.novabbs.com>
References: <uletbu$19ohv$1@dont-email.me> <5c7dd089ac74ea85a07413b08347a333@news.novabbs.com> <ALZeN.1985$U1cc.561@fx04.iad> <ulkine$2fi18$1@dont-email.me> <sDkfN.51804$Wp_8.32752@fx17.iad> <ulld29$2jkgh$1@dont-email.me> <PuFfN.53323$p%Mb.32922@fx15.iad> <ulnddo$110em$2@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="238280"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: 7e9c45bcd6d4757c5904fbe9a694742e6f8aa949
X-Rslight-Site: $2y$10$Sztv83tqIJEojoTUCLqHyexAS7AZ5s6vlmL5ULBn1iVlqEZH2Nsl2
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
 by: MitchAlsup - Sun, 17 Dec 2023 18:24 UTC

Thomas Koenig wrote:

> EricP <ThatWouldBeTelling@thevillage.com> schrieb:

>> I'm objecting to the notion of forcing a processor to reboot
>> for any reason, let alone in order to change something that is
>> under control of the operating system. There was a time before PC's
>> when computers normally ran for a year without reboot and never crashed.

When we shut down the server at Ross Technologies, it had been up for
7 years and several months. It had 16× the memory it started with,
25× the disk space, and every CPU had been upgraded multiple times
from single core 33 Mhz SUN to quad core 150 Mhz Ross modules.

Re: What the World Needs Now

<ulnegu$32bm6$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35838&group=comp.arch#35838

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: quadibloc@servername.invalid (Quadibloc)
Newsgroups: comp.arch
Subject: Re: What the World Needs Now
Date: Sun, 17 Dec 2023 18:26:38 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <ulnegu$32bm6$1@dont-email.me>
References: <uletbu$19ohv$1@dont-email.me>
<5c7dd089ac74ea85a07413b08347a333@news.novabbs.com>
<ALZeN.1985$U1cc.561@fx04.iad> <ulkine$2fi18$1@dont-email.me>
<sDkfN.51804$Wp_8.32752@fx17.iad> <ulld29$2jkgh$1@dont-email.me>
<PuFfN.53323$p%Mb.32922@fx15.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 17 Dec 2023 18:26:38 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="cef2b5320325d8dbcf8113cb4bad8f5b";
logging-data="3223238"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19YTIfClMT8sMmGGX8N9XtVtoj6bHGhuPI="
User-Agent: Pan/0.146 (Hic habitat felicitas; d7a48b4
gitlab.gnome.org/GNOME/pan.git)
Cancel-Lock: sha1:rz1bkolWbrZedTKpcn6BaXYc2oU=
 by: Quadibloc - Sun, 17 Dec 2023 18:26 UTC

On Sun, 17 Dec 2023 11:38:43 -0500, EricP wrote:

> As for Mitch's RW-no-E restriction, I am confident it will not survive
> its first encounter with actual customers (where philosophy collides
> with income).

It's true that since it is Mitch who advanced the assertion that it is
is a useful restriction here, it is he who people should debate its
needfulness with. However, I do not believe that it was _his idea_,
but rather that this restriction is *current accepted practice*, and
indeed is already implemented on a number of current processor
architectures.

That's why I decided that forcing reboot to get out of it was a
reasonable compromise between supporting legacy operation and
still having a fairly basic security feature.

John Savard

Re: What the World Needs Now

<70IfN.35564$JLvf.14490@fx44.iad>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35840&group=comp.arch#35840

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!eternal-september.org!feeder1.feed.usenet.farm!feed.usenet.farm!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx44.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: What the World Needs Now
Newsgroups: comp.arch
References: <uletbu$19ohv$1@dont-email.me> <5c7dd089ac74ea85a07413b08347a333@news.novabbs.com> <ALZeN.1985$U1cc.561@fx04.iad> <ulkine$2fi18$1@dont-email.me> <2023Dec16.183348@mips.complang.tuwien.ac.at> <ulldia$2jkgh$2@dont-email.me> <2023Dec17.091623@mips.complang.tuwien.ac.at>
Lines: 37
Message-ID: <70IfN.35564$JLvf.14490@fx44.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Sun, 17 Dec 2023 19:31:15 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Sun, 17 Dec 2023 19:31:15 GMT
X-Received-Bytes: 2497
 by: Scott Lurndal - Sun, 17 Dec 2023 19:31 UTC

anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>Quadibloc <quadibloc@servername.invalid> writes:
>>On Sat, 16 Dec 2023 17:33:48 +0000, Anton Ertl wrote:
>>> Quadibloc <quadibloc@servername.invalid> writes:
>>
>>>>Although I tend to agree with you, I also think that allowing write
>>>>permission and execute permission at the same time is highly dangerous.
>>
>>> Security theatre!
>>>
>>> Gforth uses mmap(... RWX ...) for the area where it generates native
>>> code. Now on MacOS on Apple Silicon (MacOS on Intel works fine) that
>>> mmap() fails, which means that currently the development version of
>>> Gforth does not work. When I work around this misfeature of MacOS on
>>> Apple Silicon (by disabling native code generation), Gforth will run
>>> around a factor of 2 slower on MacOS than on Linux.
>>
>>This is an argument you need to have with Mitch, rather than
>>with me.
>
>This is a newsgroup, he can read and react on my posting as well as
>you and others.
>
>>I lack the expertise to really assess how valuable not allowing
>>write and execute at the same time is; it certainly seems potentially
>>dangerous, so I went along with Mitch.
>
>The point I was making is that in the case of Gforth, it does not add
>any danger that is not already there. If you let an untrusted user
>run Gforth, it's like allowing that user to run non-suid binaries that
>that user supplied.

Assuming you're the klapatious who posted the question on stack
overflow, the answer was there - you need to switch on the jit
mode (and have the jit privilege to do what you want).

Re: What the World Needs Now

<W4IfN.35565$JLvf.25088@fx44.iad>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35841&group=comp.arch#35841

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx44.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: What the World Needs Now
Newsgroups: comp.arch
Distribution: world
References: <uletbu$19ohv$1@dont-email.me> <5c7dd089ac74ea85a07413b08347a333@news.novabbs.com> <ALZeN.1985$U1cc.561@fx04.iad> <ulkine$2fi18$1@dont-email.me> <sDkfN.51804$Wp_8.32752@fx17.iad> <ulld29$2jkgh$1@dont-email.me> <PuFfN.53323$p%Mb.32922@fx15.iad> <ulnddo$110em$2@newsreader4.netcologne.de>
Lines: 21
Message-ID: <W4IfN.35565$JLvf.25088@fx44.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Sun, 17 Dec 2023 19:36:22 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Sun, 17 Dec 2023 19:36:22 GMT
X-Received-Bytes: 1790
 by: Scott Lurndal - Sun, 17 Dec 2023 19:36 UTC

Thomas Koenig <tkoenig@netcologne.de> writes:
>EricP <ThatWouldBeTelling@thevillage.com> schrieb:
>
>> I'm objecting to the notion of forcing a processor to reboot
>> for any reason, let alone in order to change something that is
>> under control of the operating system. There was a time before PC's
>> when computers normally ran for a year without reboot and never crashed.
>
>[tkoenig@cfarm135 ~]$ uptime
> 18:03:12 up 1537 days, 19:33, 1 user, load average: 12,31, 9,59, 8,58
>[tkoenig@cfarm135 ~]$ uname -a
>Linux cfarm135 4.18.0-80.7.2.el7.ppc64le #1 SMP Thu Sep 12 15:45:05 UTC 2019 ppc64le ppc64le ppc64le GNU/Linux

My best was on a 2000 vintage sony vaio laptop running RH8 hosting sendmail, apache and named
on the internet:

Mon May 10 11:27:56 PDT 2010
11:28am up 1528 days, 6:47, 8 users, load average: 0.23, 0.12, 0.05

Got taken out by a power outage where the 10 year old laptop battery
couldn't cover the outage.

Re: What the World Needs Now

<ulnitp$337lr$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35842&group=comp.arch#35842

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: quadibloc@servername.invalid (Quadibloc)
Newsgroups: comp.arch
Subject: Re: What the World Needs Now
Date: Sun, 17 Dec 2023 19:41:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <ulnitp$337lr$1@dont-email.me>
References: <uletbu$19ohv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 17 Dec 2023 19:41:45 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="cef2b5320325d8dbcf8113cb4bad8f5b";
logging-data="3251899"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rzLvY9/E+w5C9tr/+b3M0kylgjOahDBg="
User-Agent: Pan/0.146 (Hic habitat felicitas; d7a48b4
gitlab.gnome.org/GNOME/pan.git)
Cancel-Lock: sha1:3y73QSeY5+Xmu6UTAKSgFoBWZak=
 by: Quadibloc - Sun, 17 Dec 2023 19:41 UTC

On Thu, 14 Dec 2023 12:44:46 +0000, Quadibloc wrote:

> In any case, this has inspired me to think of a feature to add to
> Concertina II. Add a new kind of header block, which must be the very
> first one, which contains an encrypted checksum of the rest of the block
> - which must be valid for the block to be allowed to execute. A mode
> exists where only blocks with such a checksum can be executed.

But given that a common feature of present-day computers is to
disable writing to blocks which contain executable code, what on
Earth does this feature provide that that one does not provide
already?

I finally came out of my mental fog to see the answer!

Let us have the computer able to put itself into a mode where
while in privileged mode, it can only execute checksummed code.

This will protect the entire kernel against tampering. But what
you really want is to protect the whole operating system, including
the nonprivileged parts, from tampering.

Well, let the MMU have, in addition to "execute" permission to
hand out, an "execute checksummed only" permission to hand out. So
the kernel uses that whenever it allocates blocks containing operating
system code (hmm, is it going to need to do deep object module
inspection to do this?)... so now these features work together.

And then, *duh*, the benefit of these checksums over no write-execute
hits me. Write execute bans protect the copy of code that's in the
memory. Checksums even protect the copy *that's residing on the
computer's disk storage*, which should be of some value.

John Savard

Re: Secrets of the ancients, What the World Needs Now

<ulnj9g$2719$1@gal.iecc.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35843&group=comp.arch#35843

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!not-for-mail
From: johnl@taugh.com (John Levine)
Newsgroups: comp.arch
Subject: Re: Secrets of the ancients, What the World Needs Now
Date: Sun, 17 Dec 2023 19:48:00 -0000 (UTC)
Organization: Taughannock Networks
Message-ID: <ulnj9g$2719$1@gal.iecc.com>
References: <uletbu$19ohv$1@dont-email.me> <ulml73$10fu3$1@newsreader4.netcologne.de> <uln60k$2m9s$1@gal.iecc.com> <uln86f$10rpl$1@newsreader4.netcologne.de>
Injection-Date: Sun, 17 Dec 2023 19:48:00 -0000 (UTC)
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970";
logging-data="72745"; mail-complaints-to="abuse@iecc.com"
In-Reply-To: <uletbu$19ohv$1@dont-email.me> <ulml73$10fu3$1@newsreader4.netcologne.de> <uln60k$2m9s$1@gal.iecc.com> <uln86f$10rpl$1@newsreader4.netcologne.de>
Cleverness: some
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: johnl@iecc.com (John Levine)
 by: John Levine - Sun, 17 Dec 2023 19:48 UTC

According to Thomas Koenig <tkoenig@netcologne.de>:
>> You make pointers two words, one for the code, one that points to the
>> display for the dynamic data. This has been a standard compiler
>> technique since the late 1960s, ...

>... which is yields ABI problems if the ABI is modeled on C,
>and on function pointers being convertible to void* and back),
>and needs requires conditional code for _each_ call through a
>function pointer, because it needs to check if it is a vanilla
>call or a call to a nested function.

Yup, after almost 50 years C still suffers from "everything is really
an int". You can use C, or you can use nested functions, but you'll be
sad if you try to do both at the same time.

I never found the lack of nested functions in C to be much of a
problem. In the rare cases where I want to do something like that,
it's not hard to pass what would have been in the display as
explicit arguments.

--
Regards,
John Levine, johnl@taugh.com, Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail. https://jl.ly

Re: What the World Needs Now

<ulnkrd$33eh1$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35846&group=comp.arch#35846

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: quadibloc@servername.invalid (Quadibloc)
Newsgroups: comp.arch
Subject: Re: What the World Needs Now
Date: Sun, 17 Dec 2023 20:14:37 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 64
Message-ID: <ulnkrd$33eh1$1@dont-email.me>
References: <uletbu$19ohv$1@dont-email.me> <ulnitp$337lr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 17 Dec 2023 20:14:37 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="cef2b5320325d8dbcf8113cb4bad8f5b";
logging-data="3258913"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/T9QkZUc+Vrfe5s87qpVg2F6fsA0oNVis="
User-Agent: Pan/0.146 (Hic habitat felicitas; d7a48b4
gitlab.gnome.org/GNOME/pan.git)
Cancel-Lock: sha1:qyWAEg07zKb4zva6OGA2u2K4/DA=
 by: Quadibloc - Sun, 17 Dec 2023 20:14 UTC

On Sun, 17 Dec 2023 19:41:45 +0000, Quadibloc wrote:

> And then, *duh*, the benefit of these checksums over no write-execute
> hits me. Write execute bans protect the copy of code that's in the
> memory. Checksums even protect the copy *that's residing on the
> computer's disk storage*, which should be of some value.

And now my vision of the secure computer of the future should be
clear.

On the front of the computer is a little panel that you can slide
open when the computer is turned off. Behind it is a switch.

The switch turns on checksum protection, or turns it off.

One starts by turning it off.

Then the installation program on the DVD-ROM drive can run
as the first thing the computer boots from. And, indeed,
the ROM BIOS can run, to tell the computer how to work the
DVD-ROM drive.

And, indeed, the first DVD-ROM you use came in the box with
your *motherboard*; it is used to install a BIOS on flash
memory which will be checksummed, so it can run when
checksum protection is turned on.

It asks you for a password, which is hashed to produce the
checksum key, stored securely in the CPU.

Then you use the DVD-ROM for installing the operating system,
with checksum protection still turned off. (Even though
you've rebooted after flashing the BIOS. Just because checksum
protection is turned off doesn't mean that checksummed code
won't run; it only means that non-checksummed code can _also_
run.)

The installer program, read in from the DVD-ROM, asks for
a password - which has to be the same one you used for
installing the BIOS - and so it now copies the object code
of the operating system to the hard drive, with appropriate
checksums, unique to _your computer_, in every block of
instructions.

Keep the password, because the operating system won't be
able to update itself without it. (So the favored method
of hacking one of these systems will be to impersonate the
update screen to *get* the key that lets one ask the CPU
to write checksums that work!)

And after the operating system is installed, when the
computer turns itself off, turn on checksum protection,
and turn the computer back on.

This basic technique can of course be augmented by using
more secure and lower-overhead techniques whereby the
computer insists on digital signatures on object modules.

Unlike the digital signature techniques now in use, though,
here the unique key is created by the user, and under the
user's control, so Windows is not privileged above Linux
as has caused controversy around Secure Boot.

John Savard

Re: What the World Needs Now

<ulnlkg$33nvb$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35847&group=comp.arch#35847

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: quadibloc@servername.invalid (Quadibloc)
Newsgroups: comp.arch
Subject: Re: What the World Needs Now
Date: Sun, 17 Dec 2023 20:28:00 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <ulnlkg$33nvb$1@dont-email.me>
References: <uletbu$19ohv$1@dont-email.me> <ulnitp$337lr$1@dont-email.me>
<ulnkrd$33eh1$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 17 Dec 2023 20:28:00 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="cef2b5320325d8dbcf8113cb4bad8f5b";
logging-data="3268587"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19NDbDYv82LPPBcAck9n6kUKgnN6jMjqQM="
User-Agent: Pan/0.146 (Hic habitat felicitas; d7a48b4
gitlab.gnome.org/GNOME/pan.git)
Cancel-Lock: sha1:iKO7CUtDkIEFr+C+aAP8lbHoBVo=
 by: Quadibloc - Sun, 17 Dec 2023 20:28 UTC

On Sun, 17 Dec 2023 20:14:37 +0000, Quadibloc wrote:

> The installer program, read in from the DVD-ROM, asks for a password -
> which has to be the same one you used for installing the BIOS -

This assumes that everyone uses the same hash algorithm
to go from a password to a checksum key.

The alternative, where every motherboard maker uses its
own hash algorithm, which then gives back a long string
of hex digits which have to be typed in during operating
system installation does not bear thinking about.

However, this gives hackers a smaller search space in which
to look for bad passwords, which are highly likely when it
is so vitally important not to forget the password which is
rarely used!

Hmm. Perhaps the BIOS installer could also think of a number,
which the user must also write down? And then the computer
might have a unique serial number which can be used also,
although that has its issues too.

John Savard

Re: What the World Needs Now

<uloo9t$3cr2r$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35857&group=comp.arch#35857

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: cr88192@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: What the World Needs Now
Date: Mon, 18 Dec 2023 00:19:36 -0600
Organization: A noiseless patient Spider
Lines: 98
Message-ID: <uloo9t$3cr2r$1@dont-email.me>
References: <uletbu$19ohv$1@dont-email.me>
<5c7dd089ac74ea85a07413b08347a333@news.novabbs.com>
<ALZeN.1985$U1cc.561@fx04.iad> <ulkine$2fi18$1@dont-email.me>
<sDkfN.51804$Wp_8.32752@fx17.iad> <ulld29$2jkgh$1@dont-email.me>
<PuFfN.53323$p%Mb.32922@fx15.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 18 Dec 2023 06:19:41 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9c1491685217355571768dff831df90e";
logging-data="3566683"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ncgsX2hRJMTgVeGw1kMrX"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:w4izW27Xxqc0SLrjz+K2ZG4ZBgU=
Content-Language: en-US
In-Reply-To: <PuFfN.53323$p%Mb.32922@fx15.iad>
 by: BGB - Mon, 18 Dec 2023 06:19 UTC

On 12/17/2023 10:38 AM, EricP wrote:
> Quadibloc wrote:
>> On Sat, 16 Dec 2023 11:54:40 -0500, EricP wrote:
>>> Quadibloc wrote:
>>
>>>> Here, making it so that once access to write plus execute is turned
>>>> off,
>>>> it can't be turned on again without a reboot seems appropriate. (Or
>>>> "potentially on", because forcing the system to boot with this enabled
>>>> isn't a good idea either. So there would be three states: RWE
>>>> available,
>>>> but off; RWE on; RWE turned permanently off until reboot. From the
>>>> third state, there is no return to the first two.)
>>
>>> Did you take a course in customer abusive design or something?
>>> Who is it you think you are going to sell this feature to?
>>
>> Well, Mitch proposes making it completely and absolutely impossible
>> for memory to both contain code that can currently be executed, and
>> for it to be writeable, at the same time.
>>
>> I recognized the logic behind this. Yet, there are cases when this
>> would be a problem. So I felt that an option might be to dial the
>> security just a tiny notch down:
>>
>> Make it _possible_ to have an operating system that did allow
>> read and execute at the same time, but _also_ make it possible for
>> an operating system not to allow it - in a way that can't be
>> subverted. The only way to change that being disabled is to reboot
>> into a different operating system that does allow it.
>>
>> John Savard
>>
>
> I'm objecting to the notion of forcing a processor to reboot
> for any reason, let alone in order to change something that is
> under control of the operating system. There was a time before PC's
> when computers normally ran for a year without reboot and never crashed.
>
> As for Mitch's RW-no-E restriction, I am confident it
> will not survive its first encounter with actual customers
> (where philosophy collides with income).
>

Yeah.
Imposing such a restriction at the ISA level is likely a bit too much of
an ask.

Better IMO to have flags to encode various modes, say:
Read Only
Read/Write
Read/Execute
Read/Write/Execute.

For these, one might have, say, a No-Write and No-Execute flag.
Write-Only and Execute-Only are not really common modes.

However, in my case, the MMU has a No-Read flag as well, so these are
technically possible.

For the main page flags, one might also have, say:
No-User (Supervisor Only)
No-Cache
Shared/Global
Valid/Present
...

If doing ACL checks, it may make sense to have a separate set of
Read/Write/Execute flags that are applied during ACL checking.

I guess, maybe relevant could be to devise a scheme for mapping ACL
checking onto a conventional page-walking style MMU design.

Where, say, one associates pairs of 16-bit Keys/ACLIDs with 16-bit field
in the tables (say: user/group/other read/write/execute flags, and some
mode-control bits for the matching rules).

Though, I guess one possible option could be to Morton-shuffle the two
IDs and then use them as a key into a page-table like structure.

With 16-bit ACLIDs, this would be a 3 level table.

For software handling, one can use a more space-efficient structure
(such as a B-Tree). But, a B-Tree walk or similar in hardware likely
isn't viable.

But, then again, ACL space is likely very sparse (if looking at pairs),
where only certain pairs of keys have anything defined, so a
page-table-like structure is unlikely to be particularly space-efficient
in this case.

....

Re: What the World Needs Now

<J_%fN.65941$Wp_8.29224@fx17.iad>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35863&group=comp.arch#35863

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!newsfeed.endofthelinebbs.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx17.iad.POSTED!not-for-mail
From: ThatWouldBeTelling@thevillage.com (EricP)
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
Newsgroups: comp.arch
Subject: Re: What the World Needs Now
References: <uletbu$19ohv$1@dont-email.me> <5c7dd089ac74ea85a07413b08347a333@news.novabbs.com> <ALZeN.1985$U1cc.561@fx04.iad> <ulkine$2fi18$1@dont-email.me> <sDkfN.51804$Wp_8.32752@fx17.iad> <ulld29$2jkgh$1@dont-email.me> <PuFfN.53323$p%Mb.32922@fx15.iad> <uloo9t$3cr2r$1@dont-email.me>
In-Reply-To: <uloo9t$3cr2r$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 52
Message-ID: <J_%fN.65941$Wp_8.29224@fx17.iad>
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Mon, 18 Dec 2023 18:15:05 UTC
Date: Mon, 18 Dec 2023 13:14:38 -0500
X-Received-Bytes: 2615
 by: EricP - Mon, 18 Dec 2023 18:14 UTC

BGB wrote:
> On 12/17/2023 10:38 AM, EricP wrote:
>>
>> As for Mitch's RW-no-E restriction, I am confident it
>> will not survive its first encounter with actual customers
>> (where philosophy collides with income).
>>
>
> Yeah.
> Imposing such a restriction at the ISA level is likely a bit too much of
> an ask.
>
> Better IMO to have flags to encode various modes, say:
> Read Only
> Read/Write
> Read/Execute
> Read/Write/Execute.
>
> For these, one might have, say, a No-Write and No-Execute flag.
> Write-Only and Execute-Only are not really common modes.
>
> However, in my case, the MMU has a No-Read flag as well, so these are
> technically possible.
>
>
> For the main page flags, one might also have, say:
> No-User (Supervisor Only)
> No-Cache
> Shared/Global
> Valid/Present
> ...

If one has super and User mode, and R,W,E enables, that's 6 PTE bits.
The PTE is very cramped so there is a big incentive to save any bits.
We can get that down to 3 PTE bits by throwing out the silly combinations,
Write-only, Execute-only, Super:NoAccess+User:RWE,...

The P-Present bit suffices for full No-Access pages.

One could hard code 8 reasonable choices from the 64 possible but
my preferred approach now is to use the 3-bit access control field
as an index to an 8-entry table with the full 6 bits for each row,
and let the OS decide which 8 combinations of Super and User accesses
make sense for it.

I'd also use a 3-bit PTE field to index an 8 entry table for cache control,
as x86 does. Though it also has to deal with legacy issues so maybe
2-bits would suffice here (depends on whether one wants to have
write-allocate vs write-noallocate as distinct selectable options).

Re: What the World Needs Now

<ulq4hi$3kmcn$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35864&group=comp.arch#35864

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: cr88192@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: What the World Needs Now
Date: Mon, 18 Dec 2023 12:54:36 -0600
Organization: A noiseless patient Spider
Lines: 121
Message-ID: <ulq4hi$3kmcn$1@dont-email.me>
References: <uletbu$19ohv$1@dont-email.me>
<5c7dd089ac74ea85a07413b08347a333@news.novabbs.com>
<ALZeN.1985$U1cc.561@fx04.iad> <ulkine$2fi18$1@dont-email.me>
<sDkfN.51804$Wp_8.32752@fx17.iad> <ulld29$2jkgh$1@dont-email.me>
<PuFfN.53323$p%Mb.32922@fx15.iad> <uloo9t$3cr2r$1@dont-email.me>
<J_%fN.65941$Wp_8.29224@fx17.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 18 Dec 2023 18:54:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9c1491685217355571768dff831df90e";
logging-data="3824023"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ncXbAcHX35S0fqKSBF5vv"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:L9USwzkDx3Hb0JLdtPXFH5XVzCw=
In-Reply-To: <J_%fN.65941$Wp_8.29224@fx17.iad>
Content-Language: en-US
 by: BGB - Mon, 18 Dec 2023 18:54 UTC

On 12/18/2023 12:14 PM, EricP wrote:
> BGB wrote:
>> On 12/17/2023 10:38 AM, EricP wrote:
>>>
>>> As for Mitch's RW-no-E restriction, I am confident it
>>> will not survive its first encounter with actual customers
>>> (where philosophy collides with income).
>>>
>>
>> Yeah.
>> Imposing such a restriction at the ISA level is likely a bit too much
>> of an ask.
>>
>> Better IMO to have flags to encode various modes, say:
>>   Read Only
>>   Read/Write
>>   Read/Execute
>>   Read/Write/Execute.
>>
>> For these, one might have, say, a No-Write and No-Execute flag.
>>   Write-Only and Execute-Only are not really common modes.
>>
>> However, in my case, the MMU has a No-Read flag as well, so these are
>> technically possible.
>>
>>
>> For the main page flags, one might also have, say:
>>   No-User (Supervisor Only)
>>   No-Cache
>>   Shared/Global
>>   Valid/Present
>>   ...
>
> If one has super and User mode, and R,W,E enables, that's 6 PTE bits.
> The PTE is very cramped so there is a big incentive to save any bits.
> We can get that down to 3 PTE bits by throwing out the silly combinations,
> Write-only, Execute-only, Super:NoAccess+User:RWE,...
>
> The P-Present bit suffices for full No-Access pages.
>

As long as the total stays under 12 bits or so, probably fine...

Say, my case:
* (11): PR.U3 (User 3, OS / Virtual Memory)
* (10): PR.U2 (User 2, OS / Virtual Memory)
* ( 9): PR.S1 (Size 1) / PR.U1 (User 1, OS / Virtual Memory)
* ( 8): PR.S0 (Size 0) / PR.U0 (User 0, OS / Virtual Memory)
* ( 7): PR.NU (Not User Accessible)
* ( 6): PR.NX (Execute Disable)
* ( 5): PR.NW (Write Disable)
* ( 4): PR.NR (Read Disable)
* ( 3): PR.NC, Page Is Volatile / Non-Cachable
* ( 2): PR.D, (Dirty)
* ( 1): PR.V1, Page Valid Mode / Shared
* ( 0): PR.V0, Page Valid Mode / Present

There are not separate user and supervisor bits in this case.

There are U4 and U5, but these only exist with 16K pages (or U6 and U7
with 64K pages).

The Dirty flag is effectively another User bit in practice, as my MMU
doesn't actually use it for anything (and is more used so the OS
page-management can keep track of if a page may be dirty by effectively
implementing a write barrier).

But, some special cases, such as "User Read Only" may be encoded:
* NC Set, NU Clear:
** NX Clear and NW Set: Secure Execute Mode (*1)
** NX Set and NW Set: User Read Only

*1: These pages allow userland to "temporarily" gain supervisor-mode
instructions, but:
Only if certain magic instructions are invoked on entering and leaving
these pages (trying to execute these instructions elsewhere is a Fault,
trying to leave without using the first exiting the mode, is a fault,
trying to use supervisor instructions without first entering
secure-execute mode via the special instructions is a fault, ...).

For page-table entries:
(63:48) holds the ACLID.

As can be noted, the ACLID and KRR register are used for additional page
access checks. The ACL handling is generally done using a separate
table. If a KRR key is not in the ACL Cache, it will raise an ACL-MISS
fault, and the ISR will load it from the table.

The ACL Cache is currently a very small but fully-associative cache
(needs at least 4-way, 8-way is better, but 8-entries is generally all
that is needed for this cache, as there tend to be only a few ACLs in
use at any given time).

Note the ACLID is not the ASID, where the ASID is held in bits (63:48)
of the TTB register (Page Table Base), with the low-order bits of TTB
mostly used to indicate the page-table layout.

> One could hard code 8 reasonable choices from the 64 possible but
> my preferred approach now is to use the 3-bit access control field
> as an index to an 8-entry table with the full 6 bits for each row,
> and let the OS decide which 8 combinations of Super and User accesses
> make sense for it.
>
> I'd also use a 3-bit PTE field to index an 8 entry table for cache control,
> as x86 does. Though it also has to deal with legacy issues so maybe
> 2-bits would suffice here (depends on whether one wants to have
> write-allocate vs write-noallocate as distinct selectable options).
>

Dunno...

>
>

Re: What the World Needs Now

<0e17e28cd97d3872f2260887512ec040@news.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35866&group=comp.arch#35866

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup)
Newsgroups: comp.arch
Subject: Re: What the World Needs Now
Date: Mon, 18 Dec 2023 19:56:14 +0000
Organization: novaBBS
Message-ID: <0e17e28cd97d3872f2260887512ec040@news.novabbs.com>
References: <uletbu$19ohv$1@dont-email.me> <5c7dd089ac74ea85a07413b08347a333@news.novabbs.com> <ALZeN.1985$U1cc.561@fx04.iad> <ulkine$2fi18$1@dont-email.me> <sDkfN.51804$Wp_8.32752@fx17.iad> <ulld29$2jkgh$1@dont-email.me> <PuFfN.53323$p%Mb.32922@fx15.iad> <uloo9t$3cr2r$1@dont-email.me> <J_%fN.65941$Wp_8.29224@fx17.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="354338"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: 7e9c45bcd6d4757c5904fbe9a694742e6f8aa949
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Rslight-Site: $2y$10$5ecd4.mL2ts6J3vGkr7yO.sSbE71e3wVXN2oXJswBO6Tr1/w2bHg2
 by: MitchAlsup - Mon, 18 Dec 2023 19:56 UTC

EricP wrote:

>
> If one has super and User mode, and R,W,E enables, that's 6 PTE bits.
> The PTE is very cramped so there is a big incentive to save any bits.
> We can get that down to 3 PTE bits by throwing out the silly combinations,
> Write-only, Execute-only, Super:NoAccess+User:RWE,...

If one uses a different page table for user and supervisor, you only
need those 3-bits. In my case Guest OS has its own table and its own
ASID completely separate from application. ASID plays the part of G
(global).

Re: What the World Needs Now

<ulr2pd$3t479$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35871&group=comp.arch#35871

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.niel.me!news.gegeweb.eu!gegeweb.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: quadibloc@servername.invalid (Quadibloc)
Newsgroups: comp.arch
Subject: Re: What the World Needs Now
Date: Tue, 19 Dec 2023 03:30:54 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <ulr2pd$3t479$1@dont-email.me>
References: <uletbu$19ohv$1@dont-email.me>
<5c7dd089ac74ea85a07413b08347a333@news.novabbs.com>
<ALZeN.1985$U1cc.561@fx04.iad> <ulkine$2fi18$1@dont-email.me>
<2023Dec16.183348@mips.complang.tuwien.ac.at>
<ulldia$2jkgh$2@dont-email.me>
<2023Dec17.091623@mips.complang.tuwien.ac.at>
<70IfN.35564$JLvf.14490@fx44.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 19 Dec 2023 03:30:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="088af4b1eae0fbc3208bfd23defcd07a";
logging-data="4100329"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yxfxG945lAzDx1nuBlWeVovi6Fsy5lsA="
User-Agent: Pan/0.146 (Hic habitat felicitas; d7a48b4
gitlab.gnome.org/GNOME/pan.git)
Cancel-Lock: sha1:28MFIszRitHzrgDEhCwKSuMu6Q4=
 by: Quadibloc - Tue, 19 Dec 2023 03:30 UTC

On Sun, 17 Dec 2023 19:31:15 +0000, Scott Lurndal wrote:

> Assuming you're the klapatious who posted the question on stack
> overflow,

I presume that's a slightly misspelled reference to Klapaucius,
a robot (along with another, named Trurl) from Stanislaw Lem's _Cyberiad_.

John Savard

Re: Secrets of the ancients, What the World Needs Now

<uls9ri$144lp$1@newsreader4.netcologne.de>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35881&group=comp.arch#35881

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-dd23-0-e011-e4d7-b00e-43ad.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Secrets of the ancients, What the World Needs Now
Date: Tue, 19 Dec 2023 14:37:38 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <uls9ri$144lp$1@newsreader4.netcologne.de>
References: <uletbu$19ohv$1@dont-email.me>
<ulml73$10fu3$1@newsreader4.netcologne.de> <uln60k$2m9s$1@gal.iecc.com>
<uln86f$10rpl$1@newsreader4.netcologne.de> <ulnj9g$2719$1@gal.iecc.com>
Injection-Date: Tue, 19 Dec 2023 14:37:38 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-dd23-0-e011-e4d7-b00e-43ad.ipv6dyn.netcologne.de:2001:4dd7:dd23:0:e011:e4d7:b00e:43ad";
logging-data="1184441"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Tue, 19 Dec 2023 14:37 UTC

John Levine <johnl@taugh.com> schrieb:
> According to Thomas Koenig <tkoenig@netcologne.de>:
>>> You make pointers two words, one for the code, one that points to the
>>> display for the dynamic data. This has been a standard compiler
>>> technique since the late 1960s, ...
>
>>... which is yields ABI problems if the ABI is modeled on C,
>>and on function pointers being convertible to void* and back),
>>and needs requires conditional code for _each_ call through a
>>function pointer, because it needs to check if it is a vanilla
>>call or a call to a nested function.
>
> Yup, after almost 50 years C still suffers from "everything is really
> an int". You can use C, or you can use nested functions, but you'll be
> sad if you try to do both at the same time.

It becomes more interesting if you want to design an ABI (or an
ABI together with an ISA) which caters well to them, or have a
C-based ABI and try to fit them in.

> I never found the lack of nested functions in C to be much of a
> problem. In the rare cases where I want to do something like that,
> it's not hard to pass what would have been in the display as
> explicit arguments.

Some languages have it in their specification (Fortran and, I
believe, Ada), so they need to be supported, and should
be supported well.

Re: Secrets of the ancients, What the World Needs Now

<ulsc6i$2lqq$1@gal.iecc.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35882&group=comp.arch#35882

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!not-for-mail
From: johnl@taugh.com (John Levine)
Newsgroups: comp.arch
Subject: Re: Secrets of the ancients, What the World Needs Now
Date: Tue, 19 Dec 2023 15:17:38 -0000 (UTC)
Organization: Taughannock Networks
Message-ID: <ulsc6i$2lqq$1@gal.iecc.com>
References: <uletbu$19ohv$1@dont-email.me> <uln86f$10rpl$1@newsreader4.netcologne.de> <ulnj9g$2719$1@gal.iecc.com> <uls9ri$144lp$1@newsreader4.netcologne.de>
Injection-Date: Tue, 19 Dec 2023 15:17:38 -0000 (UTC)
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970";
logging-data="87898"; mail-complaints-to="abuse@iecc.com"
In-Reply-To: <uletbu$19ohv$1@dont-email.me> <uln86f$10rpl$1@newsreader4.netcologne.de> <ulnj9g$2719$1@gal.iecc.com> <uls9ri$144lp$1@newsreader4.netcologne.de>
Cleverness: some
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: johnl@iecc.com (John Levine)
 by: John Levine - Tue, 19 Dec 2023 15:17 UTC

According to Thomas Koenig <tkoenig@netcologne.de>:
>> I never found the lack of nested functions in C to be much of a
>> problem. In the rare cases where I want to do something like that,
>> it's not hard to pass what would have been in the display as
>> explicit arguments.
>
>Some languages have it in their specification (Fortran and, I
>believe, Ada), so they need to be supported, and should
>be supported well.

If you want to support nested functions, it's not hard, you make
function pointers two words, the code pointer and the static chain.

As you note, what's hard is trying to retrofit that into a C model
where all pointers are the same. Then you end up with kludges like
trampolines and misaligned descriptor pointers.

--
Regards,
John Levine, johnl@taugh.com, Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail. https://jl.ly

Re: Secrets of the ancients, What the World Needs Now

<i9kgN.11546$5Hnd.8431@fx03.iad>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35884&group=comp.arch#35884

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.nntp4.net!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx03.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Secrets of the ancients, What the World Needs Now
Newsgroups: comp.arch
References: <uletbu$19ohv$1@dont-email.me> <uln86f$10rpl$1@newsreader4.netcologne.de> <ulnj9g$2719$1@gal.iecc.com> <uls9ri$144lp$1@newsreader4.netcologne.de> <ulsc6i$2lqq$1@gal.iecc.com>
Lines: 23
Message-ID: <i9kgN.11546$5Hnd.8431@fx03.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 19 Dec 2023 17:11:42 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 19 Dec 2023 17:11:42 GMT
X-Received-Bytes: 1616
 by: Scott Lurndal - Tue, 19 Dec 2023 17:11 UTC

John Levine <johnl@taugh.com> writes:
>According to Thomas Koenig <tkoenig@netcologne.de>:
>>> I never found the lack of nested functions in C to be much of a
>>> problem. In the rare cases where I want to do something like that,
>>> it's not hard to pass what would have been in the display as
>>> explicit arguments.
>>
>>Some languages have it in their specification (Fortran and, I
>>believe, Ada), so they need to be supported, and should
>>be supported well.
>
>If you want to support nested functions, it's not hard, you make
>function pointers two words, the code pointer and the static chain.

Why? Nested functions need access to containing function local _data_,
not code. The actual generated code is independent of the containing
function.

Gcc has an extension that supports nested functions.

https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html

Re: Secrets of the ancients, What the World Needs Now

<kue2p4FbsrjU1@mid.individual.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35886&group=comp.arch#35886

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: niklas.holsti@tidorum.invalid (Niklas Holsti)
Newsgroups: comp.arch
Subject: Re: Secrets of the ancients, What the World Needs Now
Date: Tue, 19 Dec 2023 19:38:44 +0200
Organization: Tidorum Ltd
Lines: 47
Message-ID: <kue2p4FbsrjU1@mid.individual.net>
References: <uletbu$19ohv$1@dont-email.me>
<ulml73$10fu3$1@newsreader4.netcologne.de> <uln60k$2m9s$1@gal.iecc.com>
<uln86f$10rpl$1@newsreader4.netcologne.de> <ulnj9g$2719$1@gal.iecc.com>
<uls9ri$144lp$1@newsreader4.netcologne.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net pAy+yALf3CxtfloGJkibAQDEB2pT9FaFYeURh+MtbQJOgmRkUg
Cancel-Lock: sha1:K85cE3qsdesiI1jfru7jHK4s0gw= sha256:IJNwQ3NwzklXSsBvx00NZxGFAYQvhSTEYwPA4Af3Nac=
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <uls9ri$144lp$1@newsreader4.netcologne.de>
 by: Niklas Holsti - Tue, 19 Dec 2023 17:38 UTC

On 2023-12-19 16:37, Thomas Koenig wrote:
> John Levine <johnl@taugh.com> schrieb:
>> According to Thomas Koenig <tkoenig@netcologne.de>:
>>>> You make pointers two words, one for the code, one that points to the
>>>> display for the dynamic data. This has been a standard compiler
>>>> technique since the late 1960s, ...
>>
>>> ... which is yields ABI problems if the ABI is modeled on C,
>>> and on function pointers being convertible to void* and back),
>>> and needs requires conditional code for _each_ call through a
>>> function pointer, because it needs to check if it is a vanilla
>>> call or a call to a nested function.
>>
>> Yup, after almost 50 years C still suffers from "everything is really
>> an int". You can use C, or you can use nested functions, but you'll be
>> sad if you try to do both at the same time.
>
> It becomes more interesting if you want to design an ABI (or an
> ABI together with an ISA) which caters well to them, or have a
> C-based ABI and try to fit them in.
>
>> I never found the lack of nested functions in C to be much of a
>> problem. In the rare cases where I want to do something like that,
>> it's not hard to pass what would have been in the display as
>> explicit arguments.
>
> Some languages have it in their specification (Fortran and, I
> believe, Ada), so they need to be supported, and should
> be supported well.

Yes, Ada supports nested subprograms, and also supports nesting for
other kinds of things such as tasks/threads.

But coding standards for high-integrity Ada applications usually forbid
nested subprograms, typically because they are difficult to unit-test,
and early in the history of Ada there were voices suggesting the same
generally, for example the 1980 paper "Nesting in Ada programs is for
the birds", https://dl.acm.org/doi/10.1145/800004.807944. From the
abstract: "Given a data abstraction construct like the Ada package and
in light of current thoughts on programming methodology, we feel that
nesting is an anachronism."

In my own (non-critical) Ada programs, small nested subprograms are not
unusual, but pointers to them are very rare (I don't recall a single
case of it).

Re: Secrets of the ancients, What the World Needs Now

<2023Dec19.191250@mips.complang.tuwien.ac.at>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35891&group=comp.arch#35891

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: Secrets of the ancients, What the World Needs Now
Date: Tue, 19 Dec 2023 18:12:50 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 27
Message-ID: <2023Dec19.191250@mips.complang.tuwien.ac.at>
References: <uletbu$19ohv$1@dont-email.me> <ulml73$10fu3$1@newsreader4.netcologne.de> <uln60k$2m9s$1@gal.iecc.com> <uln86f$10rpl$1@newsreader4.netcologne.de> <ulnj9g$2719$1@gal.iecc.com> <uls9ri$144lp$1@newsreader4.netcologne.de> <kue2p4FbsrjU1@mid.individual.net>
Injection-Info: dont-email.me; posting-host="7628c18d227e095fe136e030a4bdd11c";
logging-data="178257"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+WuzHtwD6MAt2kP/bgRtuH"
Cancel-Lock: sha1:9W1ZDzH4k+WS5hc5/8qVch/sdEw=
X-newsreader: xrn 10.11
 by: Anton Ertl - Tue, 19 Dec 2023 18:12 UTC

Niklas Holsti <niklas.holsti@tidorum.invalid> writes:
>In my own (non-critical) Ada programs, small nested subprograms are not
>unusual, but pointers to them are very rare (I don't recall a single
>case of it).

That's interesting, because a major reason for using nested functions
(or, more generally, closures), is if you need to pass a function with
a given interface, but have to pass additional data to that function.

E.g., consider a numerical integration function integrate(f,lo,hi),
which expects a function with one parameter f(x), and you want to
integrate x^y (pow(x,y) in C), where y is, say, passed as parameter.
Then you would do something like:

double intpowy(double y, double lo, double hi)
{ double f(double x)
{
return pow(x,y);
}
return integrate(f,lo,hi);
}

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

Re: Secrets of the ancients, What the World Needs Now

<kuegl7FbsrjU2@mid.individual.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35895&group=comp.arch#35895

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!paganini.bofh.team!2.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: niklas.holsti@tidorum.invalid (Niklas Holsti)
Newsgroups: comp.arch
Subject: Re: Secrets of the ancients, What the World Needs Now
Date: Tue, 19 Dec 2023 23:35:35 +0200
Organization: Tidorum Ltd
Lines: 46
Message-ID: <kuegl7FbsrjU2@mid.individual.net>
References: <uletbu$19ohv$1@dont-email.me>
<ulml73$10fu3$1@newsreader4.netcologne.de> <uln60k$2m9s$1@gal.iecc.com>
<uln86f$10rpl$1@newsreader4.netcologne.de> <ulnj9g$2719$1@gal.iecc.com>
<uls9ri$144lp$1@newsreader4.netcologne.de> <kue2p4FbsrjU1@mid.individual.net>
<2023Dec19.191250@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net g2SrSZfr4f5I5ekkbSqHtwpblwFALn2im39ojw41j3fAQ0vD2X
Cancel-Lock: sha1:J+yT3D8IY0yEW4nOoGrtH/3aXDk= sha256:XQKWvVSiquaAqGh4MU86aaze0jXYCv2He883IdFI21w=
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <2023Dec19.191250@mips.complang.tuwien.ac.at>
 by: Niklas Holsti - Tue, 19 Dec 2023 21:35 UTC

On 2023-12-19 20:12, Anton Ertl wrote:
> Niklas Holsti <niklas.holsti@tidorum.invalid> writes:
>> In my own (non-critical) Ada programs, small nested subprograms are not
>> unusual, but pointers to them are very rare (I don't recall a single
>> case of it).
>
> That's interesting, because a major reason for using nested functions
> (or, more generally, closures), is if you need to pass a function with
> a given interface, but have to pass additional data to that function.

In Ada, instead of passing a (nested) function pointer to some service
that needs such a parameter, one can implement the service as a generic
program unit, where the function to be passed is given as a generic
parameter, and instantiate that generic locally in the nested context,
thus binding the instance with the nested function.

Depending on the way the compiler implements such generics (as macros,
or with shared code) this may or may not be implemented by passing a
function pointer, but even if it is, the compiler can use a "fat
pointer" for this generic case, without being forced to use a fat
pointer for all function pointers.

> E.g., consider a numerical integration function integrate(f,lo,hi),
> which expects a function with one parameter f(x), and you want to
> integrate x^y (pow(x,y) in C), where y is, say, passed as parameter.

That is the canonical example, yes. But it happens I have never needed
to do numerical integration in my Ada programs. I do have some cases
where I have used locally instantiated generics with generic function
parameters in the way I described above. In Ada the integration example
would be declared thusly:

generic
with function F (X : Float) return Float;
function Integrate (Lo, Hi : Float) return Float;

although one would usually not limit it to a specific number type such
as Float, but would make this type also a generic (type) parameter.
IIRC, the ability to define numerical integration as a generic
subprogram, with the function to be integrated as a generic parameter,
was one of the reasons presented for omitting function pointers entirely
from original Ada (Ada 83).

Re: Secrets of the ancients, What the World Needs Now

<ult3ms$14n37$1@newsreader4.netcologne.de>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35896&group=comp.arch#35896

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-dd23-0-e011-e4d7-b00e-43ad.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Secrets of the ancients, What the World Needs Now
Date: Tue, 19 Dec 2023 21:58:52 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <ult3ms$14n37$1@newsreader4.netcologne.de>
References: <uletbu$19ohv$1@dont-email.me>
<ulml73$10fu3$1@newsreader4.netcologne.de> <uln60k$2m9s$1@gal.iecc.com>
<uln86f$10rpl$1@newsreader4.netcologne.de> <ulnj9g$2719$1@gal.iecc.com>
<uls9ri$144lp$1@newsreader4.netcologne.de>
<kue2p4FbsrjU1@mid.individual.net>
<2023Dec19.191250@mips.complang.tuwien.ac.at>
<kuegl7FbsrjU2@mid.individual.net>
Injection-Date: Tue, 19 Dec 2023 21:58:52 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-dd23-0-e011-e4d7-b00e-43ad.ipv6dyn.netcologne.de:2001:4dd7:dd23:0:e011:e4d7:b00e:43ad";
logging-data="1203303"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Tue, 19 Dec 2023 21:58 UTC

Niklas Holsti <niklas.holsti@tidorum.invalid> schrieb:

>> E.g., consider a numerical integration function integrate(f,lo,hi),
>> which expects a function with one parameter f(x), and you want to
>> integrate x^y (pow(x,y) in C), where y is, say, passed as parameter.
>
>
> That is the canonical example, yes. But it happens I have never needed
> to do numerical integration in my Ada programs. I do have some cases
> where I have used locally instantiated generics with generic function
> parameters in the way I described above. In Ada the integration example
> would be declared thusly:
>
> generic
> with function F (X : Float) return Float;
> function Integrate (Lo, Hi : Float) return Float;
>
> although one would usually not limit it to a specific number type such
> as Float, but would make this type also a generic (type) parameter.
> IIRC, the ability to define numerical integration as a generic
> subprogram, with the function to be integrated as a generic parameter,
> was one of the reasons presented for omitting function pointers entirely
> from original Ada (Ada 83).

Interesting, thanks!

Just one remark: Making numerical routines generic can be a bit
problematic if constants depend on the accuracy of a type; things
like tolerances for checks for convergence, number of coefficients
in a polynomial (or Chebyshev) evaluation, quantities to divide by
for numeric differentiation etc.

Re: Secrets of the ancients, What the World Needs Now

<dc73b645013a758c6bd9d18b0fcbfb22@news.novabbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=35897&group=comp.arch#35897

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup)
Newsgroups: comp.arch
Subject: Re: Secrets of the ancients, What the World Needs Now
Date: Tue, 19 Dec 2023 22:37:56 +0000
Organization: novaBBS
Message-ID: <dc73b645013a758c6bd9d18b0fcbfb22@news.novabbs.com>
References: <uletbu$19ohv$1@dont-email.me> <ulml73$10fu3$1@newsreader4.netcologne.de> <uln60k$2m9s$1@gal.iecc.com> <uln86f$10rpl$1@newsreader4.netcologne.de> <ulnj9g$2719$1@gal.iecc.com> <uls9ri$144lp$1@newsreader4.netcologne.de> <kue2p4FbsrjU1@mid.individual.net> <2023Dec19.191250@mips.complang.tuwien.ac.at> <kuegl7FbsrjU2@mid.individual.net> <ult3ms$14n37$1@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="473257"; mail-complaints-to="usenet@i2pn2.org";
posting-account="t+lO0yBNO1zGxasPvGSZV1BRu71QKx+JE37DnW+83jQ";
User-Agent: Rocksolid Light
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Rslight-Site: $2y$10$pfeyeG1i5W6rtTq7ZlRjzO34gXX/nxB/bNhWt76SbbaqSdENXFZwS
X-Rslight-Posting-User: 7e9c45bcd6d4757c5904fbe9a694742e6f8aa949
 by: MitchAlsup - Tue, 19 Dec 2023 22:37 UTC

Thomas Koenig wrote:

> Niklas Holsti <niklas.holsti@tidorum.invalid> schrieb:

>>> E.g., consider a numerical integration function integrate(f,lo,hi),
>>> which expects a function with one parameter f(x), and you want to
>>> integrate x^y (pow(x,y) in C), where y is, say, passed as parameter.
>>
>>
>> That is the canonical example, yes. But it happens I have never needed
>> to do numerical integration in my Ada programs. I do have some cases
>> where I have used locally instantiated generics with generic function
>> parameters in the way I described above. In Ada the integration example
>> would be declared thusly:
>>
>> generic
>> with function F (X : Float) return Float;
>> function Integrate (Lo, Hi : Float) return Float;
>>
>> although one would usually not limit it to a specific number type such
>> as Float, but would make this type also a generic (type) parameter.
>> IIRC, the ability to define numerical integration as a generic
>> subprogram, with the function to be integrated as a generic parameter,
>> was one of the reasons presented for omitting function pointers entirely
>> from original Ada (Ada 83).

> Interesting, thanks!

> Just one remark: Making numerical routines generic can be a bit
> problematic if constants depend on the accuracy of a type; things
> like tolerances for checks for convergence,

whether compiler constant arithmetic has the same numeric properties as
compiled code instruction sequences,

> number of coefficients
> in a polynomial (or Chebyshev) evaluation, quantities to divide by
> for numeric differentiation etc.


devel / comp.arch / Re: Secrets of the ancients, What the World Needs Now

Pages:1234
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor