Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The generation of random numbers is too important to be left to chance.


devel / comp.arch / Paper about ISO C

SubjectAuthor
* Paper about ISO Cclamky
+- Re: Paper about ISO CBGB
+* Re: Paper about ISO CDavid Brown
|+* Re: Paper about ISO CBGB
||+* Re: Paper about ISO CMitchAlsup
|||+* Re: Paper about ISO CMitchAlsup
||||`* Re: Paper about ISO CBranimir Maksimovic
|||| `* Re: Paper about ISO CGeorge Neuner
||||  +- Re: Paper about ISO CBranimir Maksimovic
||||  `* Re: Paper about ISO CEricP
||||   `* Re: Paper about ISO CIvan Godard
||||    `* Re: Paper about ISO CEricP
||||     `* Re: Paper about ISO CMitchAlsup
||||      +* Re: Paper about ISO CBGB
||||      |`* Re: Paper about ISO CStephen Fuld
||||      | +* Re: Paper about ISO CIvan Godard
||||      | |+* Re: addressing and protection, was Paper about ISO CJohn Levine
||||      | ||+* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |||+- Re: addressing and protection, was Paper about ISO CJohn Levine
||||      | |||+* Re: addressing and protection, was Paper about ISO CIvan Godard
||||      | ||||`- Re: addressing and protection, was Paper about ISO CQuadibloc
||||      | |||`- Re: addressing and protection, was Paper about ISO CBill Findlay
||||      | ||`* Re: addressing and protection, was Paper about ISO CQuadibloc
||||      | || +- Re: addressing and protection, was Paper about ISO CStephen Fuld
||||      | || `- Re: addressing and protection, was Paper about ISO CBranimir Maksimovic
||||      | |`* Re: addressing and protection, was Paper about ISO CEricP
||||      | | +* Re: addressing and protection, was Paper about ISO CStefan Monnier
||||      | | |`- Re: addressing and protection, was Paper about ISO CEricP
||||      | | `* Re: addressing and protection, was Paper about ISO CIvan Godard
||||      | |  +* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  |+* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  ||`* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  || `* Re: addressing and protection, was Paper about ISO CJohn Dallman
||||      | |  ||  +* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  ||  |+- Re: addressing and protection, was Paper about ISO CBGB
||||      | |  ||  |+* Re: addressing and protection, was Paper about ISO CThomas Koenig
||||      | |  ||  ||`* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  ||  || `* Re: addressing and protection, was Paper about ISO CAnton Ertl
||||      | |  ||  ||  `- Re: addressing and protection, was Paper about ISO CBGB
||||      | |  ||  |`* Re: addressing and protection, was Paper about ISO CQuadibloc
||||      | |  ||  | +- Re: addressing and protection, was Paper about ISO CQuadibloc
||||      | |  ||  | `- Re: addressing and protection, was Paper about ISO CBGB
||||      | |  ||  `- Re: addressing and protection, was Paper about ISO CBGB
||||      | |  |`* Re: addressing and protection, was Paper about ISO CJohn Dallman
||||      | |  | +* Re: addressing and protection, was Paper about ISO CThomas Koenig
||||      | |  | |`* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | | `* Re: addressing and protection, was Paper about ISO CThomas Koenig
||||      | |  | |  +* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |  |+* Re: addressing and protection, was Paper about ISO CStefan Monnier
||||      | |  | |  ||+- Re: addressing and protection, was Paper about ISO CChris M. Thomasson
||||      | |  | |  ||+* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |  |||`- Re: addressing and protection, was Paper about ISO CThomas Koenig
||||      | |  | |  ||+* Re: addressing and protection, was Paper about ISO CThomas Koenig
||||      | |  | |  |||`* Re: addressing and protection, was Paper about ISO CEricP
||||      | |  | |  ||| `- Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |  ||`- Re: addressing and protection, was Paper about ISO CJohn Dallman
||||      | |  | |  |`- Re: addressing and protection, was Paper about ISO CThomas Koenig
||||      | |  | |  `* Re: addressing and protection, was Paper about ISO CIvan Godard
||||      | |  | |   +- Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |   `* Re: addressing and protection, was Paper about ISO CStephen Fuld
||||      | |  | |    +* Address space consumption (was: addressing and protection, was Paper about ISO CStefan Monnier
||||      | |  | |    |`- Re: Address space consumption (was: addressing and protection, wasMitchAlsup
||||      | |  | |    +* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |    |`- Re: addressing and protection, was Paper about ISO CThomas Koenig
||||      | |  | |    `* Re: addressing and protection, was Paper about ISO CGeorge Neuner
||||      | |  | |     `* Re: addressing and protection, was Paper about ISO CStephen Fuld
||||      | |  | |      +* Re: addressing and protection, was Paper about ISO CMichael S
||||      | |  | |      |`* Re: addressing and protection, was Paper about ISO CTerje Mathisen
||||      | |  | |      | `- Re: addressing and protection, was Paper about ISO CMichael S
||||      | |  | |      `* Re: addressing and protection, was Paper about ISO CStefan Monnier
||||      | |  | |       +* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       |`* Re: addressing and protection, was Paper about ISO CJohn Levine
||||      | |  | |       | +* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |`* Re: addressing and protection, was Paper about ISO CStephen Fuld
||||      | |  | |       | | `* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |  `* Re: addressing and protection, was Paper about ISO CJohn Levine
||||      | |  | |       | |   +- Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |   +- Re: addressing and protection, was Paper about ISO Cclamky
||||      | |  | |       | |   `* Re: addressing and protection, was Paper about ISO CGeorge Neuner
||||      | |  | |       | |    +* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |    |`* Re: addressing and protection, was Paper about ISO CGeorge Neuner
||||      | |  | |       | |    | +* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |    | |+* Re: addressing and protection, was Paper about ISO CIvan Godard
||||      | |  | |       | |    | ||+* Re: educational computation, was addressing and protection, was Paper about ISO John Levine
||||      | |  | |       | |    | |||`* Re: educational computation, was addressing and protection, was PaperIvan Godard
||||      | |  | |       | |    | ||| `- Re: educational computation, was addressing and protection, was PaperTerje Mathisen
||||      | |  | |       | |    | ||`* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |    | || `* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |       | |    | ||  +- Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |    | ||  `- Re: addressing and protection, was Paper about ISO CDavid Brown
||||      | |  | |       | |    | |+- Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |    | |`* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |       | |    | | +* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |    | | |+- Re: addressing and protection, was Paper about ISO CIvan Godard
||||      | |  | |       | |    | | |`* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |       | |    | | | +* Re: addressing and protection, was Paper about ISO CIvan Godard
||||      | |  | |       | |    | | | |+* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |       | |    | | | ||`- Re: addressing and protection, was Paper about ISO CJimBrakefield
||||      | |  | |       | |    | | | |`* Re: addressing and protection, was Paper about ISO CTerje Mathisen
||||      | |  | |       | |    | | | | `* Re: addressing and protection, was Paper about ISO CTim Rentsch
||||      | |  | |       | |    | | | |  `- Re: addressing and protection, was Paper about ISO CTerje Mathisen
||||      | |  | |       | |    | | | +* Re: addressing and protection, was Paper about ISO CBGB
||||      | |  | |       | |    | | | `- Re: addressing and protection, was Paper about ISO CTerje Mathisen
||||      | |  | |       | |    | | `- Re: addressing and protection, was Paper about ISO CAnne & Lynn Wheeler
||||      | |  | |       | |    | `- Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | |       | |    `* Re: what is cheap these days, addressing and protection, was Paper about ISO CJohn Levine
||||      | |  | |       | +* Re: addressing and protection, was Paper about ISO CStephen Fuld
||||      | |  | |       | +* Re: addressing and protection, was Paper about ISO CMichael S
||||      | |  | |       | `* Re: addressing and protection, was Paper about ISO CMichael S
||||      | |  | |       +* RAM size (was: addressing and protection, was Paper about ISO C)Anton Ertl
||||      | |  | |       `- Re: addressing and protection, was Paper about ISO CTerje Mathisen
||||      | |  | +* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  | `* Re: addressing and protection, was Paper about ISO CJohn Levine
||||      | |  +* Re: addressing and protection, was Paper about ISO CMitchAlsup
||||      | |  `* Re: addressing and protection, was Paper about ISO CJohn Levine
||||      | `* Re: Paper about ISO CBGB
||||      `- Re: Paper about ISO CEricP
|||+* Re: Paper about ISO CBranimir Maksimovic
|||+* Re: Paper about ISO CThomas Koenig
|||+* Re: Paper about ISO Cantispam
|||`- Re: Paper about ISO CQuadibloc
||+* Re: Paper about ISO CThomas Koenig
||`* Re: Paper about ISO CDavid Brown
|+* Re: Paper about ISO CThomas Koenig
|`* Re: Paper about ISO CVictor Yodaiken
`* Re: Paper about ISO CKent Dickey

Pages:123456789101112131415161718192021222324252627282930313233
Re: addressing and protection, was Paper about ISO C

<sl5vd0$o7q$1@newsreader4.netcologne.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21594&group=comp.arch#21594

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-465a-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: addressing and protection, was Paper about ISO C
Date: Mon, 25 Oct 2021 10:03:12 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <sl5vd0$o7q$1@newsreader4.netcologne.de>
References: <sjv4u6$37u$1@dont-email.me> <sko85o$1lm$1@dont-email.me>
<skoebt$ven$1@dont-email.me> <skomk6$hb9$1@dont-email.me>
<skpdo5$93r$1@gal.iecc.com> <7oj1ng1hb9nsuq5rg6ausivk8s03piania@4ax.com>
<skr732$2b7$1@dont-email.me> <o0n9ng9kh6696spmdpvqghpnuoh7q4o4st@4ax.com>
<sl38mv$ncj$1@dont-email.me>
<1c5f66aa-d42e-45c6-a6a5-2e562aa23caen@googlegroups.com>
<sl4fg6$15f$1@dont-email.me>
<d32e7fd7-0131-4ebb-891b-fa1da6473fb2n@googlegroups.com>
<sl5bst$3j2$1@dont-email.me> <sl5mpa$shv$1@dont-email.me>
Injection-Date: Mon, 25 Oct 2021 10:03:12 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-465a-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:465a:0:7285:c2ff:fe6c:992d";
logging-data="24826"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Mon, 25 Oct 2021 10:03 UTC

Ivan Godard <ivan@millcomputing.com> schrieb:
> On 10/24/2021 9:30 PM, BGB wrote:

>> And, on the other side, people try to take stuff that is basically
>> fantasy (eg, Star Wars), and awkwardly retrofit a bunch of "science"
>> into it.
>>
>> Or, as the say, "sufficiently advanced technology is indistinguishable
>> from magic" but it is more like "sufficient technobabble over magic is
>> indistinguishable from technology".
>
> +1 !

I like "Any technology that is distinguishable from magic is
insufficiently advanced" better :-)

Re: Paper about ISO C

<86pmrtgn55.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21596&group=comp.arch#21596

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Mon, 25 Oct 2021 08:05:58 -0700
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <86pmrtgn55.fsf@linuxsc.com>
References: <87fstdumxd.fsf@hotmail.com> <mPKdnb2r0_psKe38nZ2dnUU7-UvNnZ2d@giganews.com> <86tuh6h3zi.fsf@linuxsc.com> <sl3ttc$d00$1@newsreader4.netcologne.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="5d444d568fd83e7e456f53f49d277ff0";
logging-data="14446"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+iZIkkDB6vXQR6BakqwaBgYp9VlFKhUD0="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:67ipQ+v3LqkYB95iYHmFJuntmcc=
sha1:OOZX1fjw2JxKLeXzNcMxHC9uPEI=
 by: Tim Rentsch - Mon, 25 Oct 2021 15:05 UTC

Thomas Koenig <tkoenig@netcologne.de> writes:

> Tim Rentsch <tr.17687@z991.linuxsc.com> schrieb:
>
> [...]
>
>> I realize that some of the above needs clarifying and also that
>> some of the ideas are controversial. My purpose is to start a
>> dialog (not necessarily one continuing in this newsgroup) and to
>> indicate a general direction of where I think the C standard
>> should be going. My thanks to everyone for your attention.
>
> It will be extremely hard to get consensus on what you proposed
> adopted into the current C standard. [...]

Granted.

The point of my comments is not to accomplish a particular set of
changes but to start discussion and get agreement on individual
changes (and not all at once). There are still lots of details
that need to be worked out, and I knew that while I was writing
the previous posting. Proposals for changes to the C standard
are more likely to succeed when there is consensus from a larger
group than just one person. I don't mind pitching in on the work
but I'm still just one person. If others participate and agree
then the result will be a better proposal and also one that will
carry more weight. I know some people would rather just sit back
and complain about how bad C is (or C compilers are), and who say
that things just aren't going to change. My hope is there are
other people who are more optimistic.

Like my chemistry friends used to say, if you're not part of the
solution, you're part of the precipitate.

Re: Specifying timing constraints was Re: Paper about ISO C

<86lf2hgjkd.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21597&group=comp.arch#21597

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.arch
Subject: Re: Specifying timing constraints was Re: Paper about ISO C
Date: Mon, 25 Oct 2021 09:23:14 -0700
Organization: A noiseless patient Spider
Lines: 78
Message-ID: <86lf2hgjkd.fsf@linuxsc.com>
References: <87fstdumxd.fsf@hotmail.com> <sk6s4a$9cm$1@dont-email.me> <1ed391dc-0d1d-4069-96d8-e83acbe01ba5n@googlegroups.com> <sk9ej9$fj9$1@dont-email.me> <jwvtuhj4dlq.fsf-monnier+comp.arch@gnu.org> <skc7a9$698$1@dont-email.me> <skc905$85c$1@dont-email.me> <skh20o$ji2$1@dont-email.me> <4fc4f707-2d42-492a-bd41-f791141dbfb2n@googlegroups.com> <skhjk3$9p4$1@dont-email.me> <f9db2e75-2ec2-4572-b211-a8b2d6b3e0e6n@googlegroups.com> <skjkqv$nd3$1@dont-email.me> <0ba079c3-d672-47b3-b86d-cfc74520ca5dn@googlegroups.com> <86a6j6l8ci.fsf@linuxsc.com> <LClbJ.602$xjIc.241@fx01.iad> <skl12c$i1n$1@dont-email.me> <qgDbJ.3$in7.0@fx22.iad> <skn1iv$ap3$1@dont-email.me> <skn3ib$ouk$1@dont-email.me> <86ilxnii8c.fsf@linuxsc.com> <itkgveFa1f5U1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="5d444d568fd83e7e456f53f49d277ff0";
logging-data="1431"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/SSPAnZfJ2gV8Es7SogX0uy01Zk1/DgDc="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:z8dznNH2/7/L01ATrv09yZZub3w=
sha1:Sxl4uBjtPCzLy8J1AoszbTt1J7g=
 by: Tim Rentsch - Mon, 25 Oct 2021 16:23 UTC

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

> On 2021-10-23 23:44, Tim Rentsch wrote:
>
>> Ivan Godard <ivan@millcomputing.com> writes:
>>
>>> On 10/19/2021 11:08 AM, Stephen Fuld wrote:
>>>
>>>> On 10/19/2021 9:20 AM, EricP wrote:
>>>>
>>>>> Ivan Godard wrote:
>>>>>
>>>>>> On 10/18/2021 2:23 PM, EricP wrote:
>>>>>>
>>>>>>> The only mechanism I can think of that can handle that kind of
>>>>>>> flexibility smoothly would be based on multiple language data
>>>>>>> types, and an ISA with separate instructions for each operation
>>>>>>> on each type.
>>>>>>
>>>>>> As for example:
>>>>>> enumWithTraits(intNumEnums, overflowCode,
>>>>>> excepting,
>>>>>> modulo,
>>>>>> saturating,
>>>>>> widening
>>>>>> );
>>>>>> available in every kind of operation that can overflow?
>>>>>
>>>>> I don't know what you mean.
>>>>>
>>>>> I mean that only the programmer knows their intent and since
>>>>> that intent changes and they need a way to express it.
>>>>> A one-size-fits-all approach isn't flexible enough.
>>>>>
>>>>> The compiler already handles overloading operators for different
>>>>> integral and float data types and sizes. This expands on that
>>>>> mechanism.
>>>>
>>>> I think the disconnect is the following. Ivan showed what
>>>> capabilities are/will be in the Mill hardware ISA. You talked
>>>> about what the programmer intends. The disconnect is that the
>>>> current C language doesn't provide a mechanism to "connect" the
>>>> two, at least in many cases. Several proposals have been made here
>>>> (pragmas, compile options, etc.), but none are apparently part of
>>>> the standard.
>>>>
>>>> I should note that at least a good part of these are specifiable in,
>>>> for example Ada. The very extensive type system in Ada is, IMO one
>>>> of its biggest strengths.
>>>
>>> Well put. Besides Ada, also consider C++ in which you can define
>>> classes saturatingShort, saturatingInt, etc and overload the
>>> operators to produce an intrinsic which in turn invokes a native
>>> instruction (Mill) or sequence (whatever). Writing the library is
>>> annoying, but using it is convenient and natural.
>>
>> Let me offer a different perspective here. User-defined types
>> work well for situations where there is only one operand of an
>> "unusual" type, or where several operands are homogeneous in a
>> particular "unusual" type. A key aspect of the problem here is
>> not when all the operands have the same type but when they may
>> have different types.
>
> In the Ada case, the idea (= spirit) is that you cannot combine
> different types in that way -- for example, you cannot by default
> add a signed integer to a modular integer. The programmer has to
> convert one or both operands explicitly to compatible types,

I understand. My point is about environments like C or C++
where mixing of different types is allowed, and the result
type depends on the operand types.

> or [let the compiler know in some other way what it should do in
> various specific cases, such as function overloading]

This alternative illustrates the kinds of problems I'm talking
about. Types have to know, in some sense, about other types,
and the resultant code growth in N*N rather than linear.

Re: Specifying timing constraints was Re: Paper about ISO C

<86h7d5gj97.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21598&group=comp.arch#21598

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.arch
Subject: Re: Specifying timing constraints was Re: Paper about ISO C
Date: Mon, 25 Oct 2021 09:29:56 -0700
Organization: A noiseless patient Spider
Lines: 96
Message-ID: <86h7d5gj97.fsf@linuxsc.com>
References: <87fstdumxd.fsf@hotmail.com> <sk6s4a$9cm$1@dont-email.me> <1ed391dc-0d1d-4069-96d8-e83acbe01ba5n@googlegroups.com> <sk9ej9$fj9$1@dont-email.me> <jwvtuhj4dlq.fsf-monnier+comp.arch@gnu.org> <skc7a9$698$1@dont-email.me> <skc905$85c$1@dont-email.me> <skh20o$ji2$1@dont-email.me> <4fc4f707-2d42-492a-bd41-f791141dbfb2n@googlegroups.com> <skhjk3$9p4$1@dont-email.me> <f9db2e75-2ec2-4572-b211-a8b2d6b3e0e6n@googlegroups.com> <skjkqv$nd3$1@dont-email.me> <0ba079c3-d672-47b3-b86d-cfc74520ca5dn@googlegroups.com> <86a6j6l8ci.fsf@linuxsc.com> <LClbJ.602$xjIc.241@fx01.iad> <skl12c$i1n$1@dont-email.me> <qgDbJ.3$in7.0@fx22.iad> <skn1iv$ap3$1@dont-email.me> <skn3ib$ouk$1@dont-email.me> <86ilxnii8c.fsf@linuxsc.com> <sl20bg$uha$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="5d444d568fd83e7e456f53f49d277ff0";
logging-data="1431"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19AJro6WykFk9g95B7AR5bDIKvY8QXkpW0="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:UP3AJ+OvnughMnvA2zpwRDB3LHM=
sha1:ZZngo1/6dkh9SGY3CU78h1OGxc8=
 by: Tim Rentsch - Mon, 25 Oct 2021 16:29 UTC

Ivan Godard <ivan@millcomputing.com> writes:

> On 10/23/2021 1:44 PM, Tim Rentsch wrote:
>
>> Ivan Godard <ivan@millcomputing.com> writes:
>>
>>> On 10/19/2021 11:08 AM, Stephen Fuld wrote:
>>>
>>>> On 10/19/2021 9:20 AM, EricP wrote:
>>>>
>>>>> Ivan Godard wrote:
>>>>>
>>>>>> On 10/18/2021 2:23 PM, EricP wrote:
>>>>>>
>>>>>>> The only mechanism I can think of that can handle that kind of
>>>>>>> flexibility smoothly would be based on multiple language data
>>>>>>> types, and an ISA with separate instructions for each operation
>>>>>>> on each type.
>>>>>>
>>>>>> As for example:
>>>>>> enumWithTraits(intNumEnums, overflowCode,
>>>>>> excepting,
>>>>>> modulo,
>>>>>> saturating,
>>>>>> widening
>>>>>> );
>>>>>> available in every kind of operation that can overflow?
>>>>>
>>>>> I don't know what you mean.
>>>>>
>>>>> I mean that only the programmer knows their intent and since
>>>>> that intent changes and they need a way to express it.
>>>>> A one-size-fits-all approach isn't flexible enough.
>>>>>
>>>>> The compiler already handles overloading operators for different
>>>>> integral and float data types and sizes. This expands on that
>>>>> mechanism.
>>>>
>>>> I think the disconnect is the following. Ivan showed what
>>>> capabilities are/will be in the Mill hardware ISA. You talked
>>>> about what the programmer intends. The disconnect is that the
>>>> current C language doesn't provide a mechanism to "connect" the
>>>> two, at least in many cases. Several proposals have been made here
>>>> (pragmas, compile options, etc.), but none are apparently part of
>>>> the standard.
>>>>
>>>> I should note that at least a good part of these are specifiable in,
>>>> for example Ada. The very extensive type system in Ada is, IMO one
>>>> of its biggest strengths.
>>>
>>> Well put. Besides Ada, also consider C++ in which you can define
>>> classes saturatingShort, saturatingInt, etc and overload the
>>> operators to produce an intrinsic which in turn invokes a native
>>> instruction (Mill) or sequence (whatever). Writing the library is
>>> annoying, but using it is convenient and natural.
>>
>> Let me offer a different perspective here. User-defined types
>> work well for situations where there is only one operand of an
>> "unusual" type, or where several operands are homogeneous in a
>> particular "unusual" type. A key aspect of the problem here is
>> not when all the operands have the same type but when they may
>> have different types. In many cases we want the choice of
>> trapping or wrapping or saturating to go with the operation, not
>> with the types of operands used. What should the result be in a
>> case where a trapping short and a wrapping int and a saturating
>> long are all added together? The combination of width on one
>> axis and choice of behavior rule on a different axis means a
>> non-linear number of types to define. To branch off a bit, now
>> add the aspect of units for different quantities. What should
>> happen if a saturating long inch is added to a saturating long
>> centimeter? User-defined types don't scale well when there are
>> multiple independent axes. Also there is the question of
>> understanding what the consequences are when different types are
>> combined. My experience doing this kind of thing in C++ leads me
>> to think figuring out the interactions along different axes would
>> be challenging, even just as a client of an existing set of
>> classes.

[...]

> As for your sum of sat+wrap+trunc, there's a simple solution: don't
> pollute the types of the operations with the types of the
> arguments. Let + take arguments and produce results from Z, and then
> check when that is assigned or passed to see if it conforms to the
> well defined and unambiguous type of the destination. [...]

That's fine if that behavior is what is wanted. My comment is
about a wider range of application, including for example
combination rules more like what C or C++ have. What you are
saying, in effect, is that user-defined types work just fine, but
only if we are willing to change how things work; in short they
offer a great solution, but to a different problem.

> Yes, Ada got it right, thank you.

I have gotten conflicting information on that point.

Re: Use Rust instead? (Was Re: Paper about ISO C)

<2021Oct25.181949@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21599&group=comp.arch#21599

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: Use Rust instead? (Was Re: Paper about ISO C)
Date: Mon, 25 Oct 2021 16:19:49 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 57
Message-ID: <2021Oct25.181949@mips.complang.tuwien.ac.at>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me> <cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com> <sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org> <2021Oct12.185057@mips.complang.tuwien.ac.at> <jwvzgre88y4.fsf-monnier+comp.arch@gnu.org> <5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com> <sku3dr$1hb$2@dont-email.me> <5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com> <2021Oct23.192433@mips.complang.tuwien.ac.at> <sl3m7f$11am$1@gioia.aioe.org>
Injection-Info: reader02.eternal-september.org; posting-host="b42143063d551d6dc122d6d7cabeda20";
logging-data="22388"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX194A8fWcKc+ceJsxeGjICdg"
Cancel-Lock: sha1:OreMdW015+eeTxI+VkfCsGN8sXQ=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Mon, 25 Oct 2021 16:19 UTC

Terje Mathisen <terje.mathisen@tmsw.no> writes:
>Anton Ertl wrote:
>> Quadibloc <jsavard@ecn.ab.ca> writes:
>>> That isn't a solution. If the problem is to satisfy both sides,
>>> killing the branch of the language that satisfies one of them
>>> constitutes failure; one side is not satisfied.
>>>
>>> However, reality is more complex than that. The reality is
>>> that C99 and gcc are viewed by the dissatisfied side as
>>> just that "solution" as having happened already...
>>
>> Actually, it seems to me that C++ is the solution for the nasal demon
>> worshippers. And once C compilers started to be written by C++
>> programmers, they applied the C++ view of how to deal with undefined
>> behaviour also to C.
>
>So why aren't more people switching to Rust?

More generally, why aren't people switching to other programming
languages? Because they have a legacy of C code. For new projects,
switching to a different language is much easier, although of course
in a C shop, switching still incurs some pain.

E.g., in Gforth we plan to do a Forth native-code compiler in Forth to
replace the existing virtual machine interpreter written in C (and
native-code generator that copies native code produced by the gcc);
But even when we have done that, eliminating C completely will be
hard; the current plan still has C there for bootstrapping purposes.

As for Rust specifically, my impression is that Rust is a solution for
those who want to restrict themselves to the discipline represented by
the Rust type system, and they get nice properties (no undefined
behaviour(?)) from it. But if what you want to do lies outside of
that realm, you have to take the escape hatch, and are back where you
started. But at least the Rust compiler will tell you when you tread
beyond the pale, unlike with C undefined behaviour.

>I took a look at RustCrypto, specifically how they handle bigint
>operations, and I was extremely impressed: You get the exact same direct
>access to both 64 and 128-bit signed and unsigned ints, and the
>naive/natural way to express "(hi, lo) = a + ( b*c) + carry" works
>as-is, and generates the same optimal code as you can get from clang
>when compiling C(++).

What else do you expect? It's the same back end.

>In Rust aliasing is even less of a problem than in Fortran afaik. :-)

Damning with faint praise? Fortran's touted benefit is that it will
assume function parameters don't alias. I.e., if you pass overlapping
parameters, bad things can happen. I would really hope that Rust does
not have this problem, otherwise it would lose the major benefit it has.

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

Re: addressing and protection, was Paper about ISO C

<86czntgf6p.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21600&group=comp.arch#21600

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.arch
Subject: Re: addressing and protection, was Paper about ISO C
Date: Mon, 25 Oct 2021 10:57:50 -0700
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <86czntgf6p.fsf@linuxsc.com>
References: <sjv4u6$37u$1@dont-email.me> <sko85o$1lm$1@dont-email.me> <skoebt$ven$1@dont-email.me> <skomk6$hb9$1@dont-email.me> <skpdo5$93r$1@gal.iecc.com> <7oj1ng1hb9nsuq5rg6ausivk8s03piania@4ax.com> <skr732$2b7$1@dont-email.me> <o0n9ng9kh6696spmdpvqghpnuoh7q4o4st@4ax.com> <sl38mv$ncj$1@dont-email.me> <1c5f66aa-d42e-45c6-a6a5-2e562aa23caen@googlegroups.com> <sl4fg6$15f$1@dont-email.me> <d32e7fd7-0131-4ebb-891b-fa1da6473fb2n@googlegroups.com> <sl4n8i$kt$1@dont-email.me> <sl5qi9$nf6$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="5d444d568fd83e7e456f53f49d277ff0";
logging-data="12225"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qIvsvoII0e1DtF6LU4JXVzhLisak5zuQ="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:4QTUE8hzpZJWb38BHTnLh0tZL9I=
sha1:caOOMMDyhvW4Q8Mo9Kh4X4awvHI=
 by: Tim Rentsch - Mon, 25 Oct 2021 17:57 UTC

Terje Mathisen <terje.mathisen@tmsw.no> writes:

> Ivan Godard wrote:
>
>> Here's a quick one, looks like an algebra problem but is actually
>> for 3D visualization. It was on a scholarship test, and we later
>> used it in recruiting at PDC:
>>
>> Given a cube, one on a side. Inscribed sphere, tangent to the cube's
>> faces. In each corner an inscribed sphere, tangent to the three cube
>> faces and the central sphere. What is the volume of the cube not
>> occupied by the spheres?
>
> That seemed really hard, but I'm pretty sure it helps a lot to realize
> that each of those smaller corner spheres can have a smaller cube
> around it, and that three of those cube faces will overlap with the
> larger cube. This means that first, the diagonal distance from the
> large sphere to a corner will be (3^-3 - 1)/2, or about 0.22.

Of course you mean sqrt(3), not 3**-3 or 3**(1./3.)

> That
> distance will then be split by a small sphere with the same ratio from
> center to corner, or (1+power(3,1/3)) * (-1+power(3,1/3)) / 4.
>
> Am I on the right track?

Here is how I reasoned it.

First I considered just one corner of the cube, with a unit
sphere (so radius one) inside, rather than a unit cube (so
in my case the cube is 2x2x2, but one corner of it is 1x1x1).

The diagonal of the corner cube is sqrt(3). The corner part
of the sphere still has radius one.

The inset sphere in the corner, let me assign that radius k.
The tangent point and center of the inset sphere are collinear
with the center of the large sphere and the corner of the
corner cube. Like what you point out, the inset sphere has
an octant that is tangent to the cube corner, with distance k
between the inset sphere center to each face, so that means

1 + k + k sqrt(3) = sqrt(3)

which lets us solve for k, so we know the volume of one
inset sphere.

For the answer, the volume of the cube corner is 1, and
the volume of this octant of the large sphere is 4/3 pi / 8
and the volume of the inset sphere is 4/3 pi k**3, with
the volume of the cube corner being 1, giving

1 - 4/3 pi /8 - 4/3 pi k**3

Of course that's only one eighth of the whole thing, but
since we started with a linear scale factor of two the
multiply by 8 and divide by 8 cancel, and that's our
answer. At least, I hope it is.. I know my mental
machinery is not always reliable.

Bonus problem: same question, but for a 4-dimensional
cube with 4-dimensional spheres.

Re: Paper about ISO C

<2021Oct25.192614@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21601&group=comp.arch#21601

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Mon, 25 Oct 2021 17:26:14 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 45
Message-ID: <2021Oct25.192614@mips.complang.tuwien.ac.at>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me> <cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com> <sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org> <2021Oct12.185057@mips.complang.tuwien.ac.at> <jwvzgre88y4.fsf-monnier+comp.arch@gnu.org> <5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com> <sku3dr$1hb$2@dont-email.me> <5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com> <2021Oct23.192433@mips.complang.tuwien.ac.at> <sl3ch6$vlr$1@dont-email.me>
Injection-Info: reader02.eternal-september.org; posting-host="b42143063d551d6dc122d6d7cabeda20";
logging-data="12268"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18HNKEg6Cg9moAqVLOI/+hA"
Cancel-Lock: sha1:y6+IgbKVQxpb2oNM/ODAoe8t6D0=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Mon, 25 Oct 2021 17:26 UTC

David Brown <david.brown@hesbynett.no> writes:
>On 23/10/2021 19:24, Anton Ertl wrote:
>> Actually, it seems to me that C++ is the solution for the nasal demon
>> worshippers. And once C compilers started to be written by C++
>> programmers, they applied the C++ view of how to deal with undefined
>> behaviour also to C.
....
>But since I
>have no idea what a "C++ view of UB" might be or how it might differ
>from a "C view of UB"

I am not surprised.

Just in case somebody else finds my statement too cryptic: There have been
dialogs along the lines of

A: Assuming that programs do not perform undefined behaviour allows
optimizing "a*2/2" into "a", and that's important for performance.

B: But nobody writes such code with the intention of it being
optimized into "a". If I want "a", I write "a", and if I write
"a*2/2", I want something other than "a" in the overflow case.

A: It could be the result of macro expansion.

B: Oh, really?

Recently someone mentioned some C++ principle in connection with
undefined behaviour; something like "zero-cost abstractions". And
then I realized that in the C++ world people may write code that's
quite far from the base language, and this is processed by the
template processor in several layers until it arrives in the base
layer, and the end result may indeed contain something like "a*2/2",
and the C++ programmer may indeed want that to be optimized to "a". I
still find it hard to believe that such code occurs in expanded C++
code, but the point is that a C++ programmer probably finds it easy to
believe.

In the dialog above A exhibits the C++ view of how to deal with
undefined behaviour, while B doesn't.

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

Re: Paper about ISO C

<868ryhgf3p.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21602&group=comp.arch#21602

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Mon, 25 Oct 2021 10:59:38 -0700
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <868ryhgf3p.fsf@linuxsc.com>
References: <87fstdumxd.fsf@hotmail.com> <sjni60$97d$1@dont-email.me> <sjnmcp$630$1@dont-email.me> <ca22ba8c-2f32-4999-a2d0-edde18d97a24n@googlegroups.com> <hiN7J.53059$3p3.5024@fx16.iad> <9e23mg1uk377av16575v343v97f128bbe6@4ax.com> <Gwh8J.222306$T_8.186929@fx48.iad> <j6i3mg16rc2f6d99n7u64cmebnvq02d407@4ax.com> <9a019b14-481d-4ae9-a8ae-8f0c2d94bf57n@googlegroups.com> <vpc8mg9nie7kcpik5knob6po2rt4goftvd@4ax.com> <864k9mp8d2.fsf@linuxsc.com> <sk4eht$b89$1@dont-email.me> <86ee8bibia.fsf@linuxsc.com> <23a7aa84-1619-497c-b435-95d647cb0c62n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="5d444d568fd83e7e456f53f49d277ff0";
logging-data="12225"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+noGPSbM7j+NICXhgp+vAiX2YF2j0uCSQ="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:Hw8whRYw5TPKbIyXNYV1k1i5qEQ=
sha1:6LHmYEXPT27ScBPSBfc8Sj7zBj4=
 by: Tim Rentsch - Mon, 25 Oct 2021 17:59 UTC

MitchAlsup <MitchAlsup@aol.com> writes:

> On Saturday, October 23, 2021 at 6:09:53 PM UTC-5, Tim Rentsch wrote:
>
>> BGB <cr8...@gmail.com> writes:
>>
>>> On 10/12/2021 10:31 AM, Tim Rentsch wrote:
>>>
>>>> George Neuner <gneu...@comcast.net> writes:
>>>>
>>>> [...]
>>>>
>>>>> GCs for uncooperative languages (like C) do check potential
>>>>> pointers - i.e. properly aligned values - against the heap limits
>>>>> as a first step. But what the GC really needs to know is if a
>>>>> pointer refers to an actual allocated block. Determining /that/
>>>>> is a lot harder because the value must be range checked against
>>>>> every allocation, not just against the heap limits.
>>>>
>>>> It does take more development effort. It need not incur a
>>>> significantly larger run-time cost.
>>>
>>> Average-case cost for many GC designs is fairly low.
>>>
>>> One downside is the creation of delays or stalls.
>>>
>>> For example, if one has a mark/sweep collector, there is a visible
>>> (and potentially fairly obvious) stall whenever the GC runs. In a
>>> soft-real-time application (like a 3D game), it can get really
>>> annoying to have a game which periodically stalls.
>>>
>>> In harder real-time uses, these sorts of delays are unacceptable.
>>> [...]
>>
>> Certainly it is true that many GC schemes can have large delays
>> at times, and that for some applications such delays are absolutely
>> unacceptable.
>>
>> However, it is also true that some GC schemes have large delays
>> only very rarely (with much shorter delays being more common),
>> and also that some applications don't mind long delays at all as
>> long as the amortized cost is fairly low.
>>
>> More generally, the kinds of arguments I see against using GC
>> tend to be pointing out that there are some situations where
>> using GC doesn't satisfy the requirements. And that's true:
>> some applications are so demanding and resource hungry that
>> they need a lot of care and specialized machinery to get done
>> whatever it is they need to get done, and trying to use GC
>> can get in the way of that.
>>
>> Unfortunately the implicit argument that follows is that because
>> GC isn't good everywhere that it must not be good anywhere.
>> Obviously that's a bogus argument (which explains why it is
>> almost always implicit).
>>
>> In truth GC works just fine for many or most application areas,
>
> The other truth is that most applications do not need any GC whatsoever.
> {Where most means over 50%}

That is a vacuous statement.

Re: Paper about ISO C

<2faae7cb-1004-4074-abeb-47a8e1729ed9n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21603&group=comp.arch#21603

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:6214:1754:: with SMTP id dc20mr9662894qvb.33.1635186567344;
Mon, 25 Oct 2021 11:29:27 -0700 (PDT)
X-Received: by 2002:a05:6808:144b:: with SMTP id x11mr24037353oiv.175.1635186567143;
Mon, 25 Oct 2021 11:29:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Mon, 25 Oct 2021 11:29:26 -0700 (PDT)
In-Reply-To: <868ryhgf3p.fsf@linuxsc.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:695b:13df:ff8e:2842;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:695b:13df:ff8e:2842
References: <87fstdumxd.fsf@hotmail.com> <sjni60$97d$1@dont-email.me>
<sjnmcp$630$1@dont-email.me> <ca22ba8c-2f32-4999-a2d0-edde18d97a24n@googlegroups.com>
<hiN7J.53059$3p3.5024@fx16.iad> <9e23mg1uk377av16575v343v97f128bbe6@4ax.com>
<Gwh8J.222306$T_8.186929@fx48.iad> <j6i3mg16rc2f6d99n7u64cmebnvq02d407@4ax.com>
<9a019b14-481d-4ae9-a8ae-8f0c2d94bf57n@googlegroups.com> <vpc8mg9nie7kcpik5knob6po2rt4goftvd@4ax.com>
<864k9mp8d2.fsf@linuxsc.com> <sk4eht$b89$1@dont-email.me> <86ee8bibia.fsf@linuxsc.com>
<23a7aa84-1619-497c-b435-95d647cb0c62n@googlegroups.com> <868ryhgf3p.fsf@linuxsc.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2faae7cb-1004-4074-abeb-47a8e1729ed9n@googlegroups.com>
Subject: Re: Paper about ISO C
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Mon, 25 Oct 2021 18:29:27 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 64
 by: MitchAlsup - Mon, 25 Oct 2021 18:29 UTC

On Monday, October 25, 2021 at 12:59:40 PM UTC-5, Tim Rentsch wrote:
> MitchAlsup <Mitch...@aol.com> writes:
>
> > On Saturday, October 23, 2021 at 6:09:53 PM UTC-5, Tim Rentsch wrote:
> >
> >> BGB <cr8...@gmail.com> writes:
> >>
> >>> On 10/12/2021 10:31 AM, Tim Rentsch wrote:
> >>>
> >>>> George Neuner <gneu...@comcast.net> writes:
> >>>>
> >>>> [...]
> >>>>
> >>>>> GCs for uncooperative languages (like C) do check potential
> >>>>> pointers - i.e. properly aligned values - against the heap limits
> >>>>> as a first step. But what the GC really needs to know is if a
> >>>>> pointer refers to an actual allocated block. Determining /that/
> >>>>> is a lot harder because the value must be range checked against
> >>>>> every allocation, not just against the heap limits.
> >>>>
> >>>> It does take more development effort. It need not incur a
> >>>> significantly larger run-time cost.
> >>>
> >>> Average-case cost for many GC designs is fairly low.
> >>>
> >>> One downside is the creation of delays or stalls.
> >>>
> >>> For example, if one has a mark/sweep collector, there is a visible
> >>> (and potentially fairly obvious) stall whenever the GC runs. In a
> >>> soft-real-time application (like a 3D game), it can get really
> >>> annoying to have a game which periodically stalls.
> >>>
> >>> In harder real-time uses, these sorts of delays are unacceptable.
> >>> [...]
> >>
> >> Certainly it is true that many GC schemes can have large delays
> >> at times, and that for some applications such delays are absolutely
> >> unacceptable.
> >>
> >> However, it is also true that some GC schemes have large delays
> >> only very rarely (with much shorter delays being more common),
> >> and also that some applications don't mind long delays at all as
> >> long as the amortized cost is fairly low.
> >>
> >> More generally, the kinds of arguments I see against using GC
> >> tend to be pointing out that there are some situations where
> >> using GC doesn't satisfy the requirements. And that's true:
> >> some applications are so demanding and resource hungry that
> >> they need a lot of care and specialized machinery to get done
> >> whatever it is they need to get done, and trying to use GC
> >> can get in the way of that.
> >>
> >> Unfortunately the implicit argument that follows is that because
> >> GC isn't good everywhere that it must not be good anywhere.
> >> Obviously that's a bogus argument (which explains why it is
> >> almost always implicit).
> >>
> >> In truth GC works just fine for many or most application areas,
> >
> > The other truth is that most applications do not need any GC whatsoever.
> > {Where most means over 50%}
>
> That is a vacuous statement.
<
OK, how much GC does 'cat' need ? 'more' ? 'less', 'ls', '|', 'vi',.....'dev/null',...

Re: Paper about ISO C

<sl6t72$rfa$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21604&group=comp.arch#21604

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Mon, 25 Oct 2021 20:32:02 +0200
Organization: A noiseless patient Spider
Lines: 79
Message-ID: <sl6t72$rfa$1@dont-email.me>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<2021Oct23.192433@mips.complang.tuwien.ac.at> <sl3ch6$vlr$1@dont-email.me>
<2021Oct25.192614@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 25 Oct 2021 18:32:02 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a5438c96186927b7a6a5f2a6654af5ec";
logging-data="28138"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HCGanDGkiibjFn/nwS7awW9hFtzmoljM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:XNgOYTVu9V4ux+OXGLriUi/mAXA=
In-Reply-To: <2021Oct25.192614@mips.complang.tuwien.ac.at>
Content-Language: en-GB
 by: David Brown - Mon, 25 Oct 2021 18:32 UTC

On 25/10/2021 19:26, Anton Ertl wrote:
> David Brown <david.brown@hesbynett.no> writes:
>> On 23/10/2021 19:24, Anton Ertl wrote:
>>> Actually, it seems to me that C++ is the solution for the nasal demon
>>> worshippers. And once C compilers started to be written by C++
>>> programmers, they applied the C++ view of how to deal with undefined
>>> behaviour also to C.
> ...
>> But since I
>> have no idea what a "C++ view of UB" might be or how it might differ
>>from a "C view of UB"
>
> I am not surprised.
>
> Just in case somebody else finds my statement too cryptic: There have been
> dialogs along the lines of
>
> A: Assuming that programs do not perform undefined behaviour allows
> optimizing "a*2/2" into "a", and that's important for performance.
>
> B: But nobody writes such code with the intention of it being
> optimized into "a". If I want "a", I write "a", and if I write
> "a*2/2", I want something other than "a" in the overflow case.
>

Perhaps that applies to some programmers. Some other people write code
that might contain a range of small functions and macros which they
expect to be inlined with corresponding optimisations including
re-arrangement of expressions, constant propagation, strength reduction,
etc. They expect the compiler to generate results using the "as-if"
rule to get efficient results. It is the job of the programmer to write
clear, maintainable and flexible code - it is the job of the compiler to
turn that into efficient object code. The programmer is expected to
understand and follow the rules of the language, as is the compiler. If
the programmer wants a particular result or effect but does not describe
it correctly in the language, he/she can't expect the compiler to be a
mind-reader and give them something they did not ask for.

> A: It could be the result of macro expansion.
>
> B: Oh, really?

Yes, really. Or the result of function inlining, constant propagation,
function cloning, or many other optimisation techniques. C++ code in
particular would often be useless if such optimisations were not used.

Of course turning "a * 2 / 2" into "a" is not going to come up very
often, or make a big difference - it's just one of countless small
optimisations, each making a tiny contribution on average but summing to
a significant improvement overall.

>
> Recently someone mentioned some C++ principle in connection with
> undefined behaviour; something like "zero-cost abstractions". And
> then I realized that in the C++ world people may write code that's
> quite far from the base language, and this is processed by the
> template processor in several layers until it arrives in the base
> layer, and the end result may indeed contain something like "a*2/2",
> and the C++ programmer may indeed want that to be optimized to "a". I
> still find it hard to believe that such code occurs in expanded C++
> code, but the point is that a C++ programmer probably finds it easy to
> believe.
>
> In the dialog above A exhibits the C++ view of how to deal with
> undefined behaviour, while B doesn't.
>

Eh, okay. If you say so.

To me it sounds more like A is a mixture of an understanding of the
language combined with an exaggerated hope for optimisation (which you
no doubt added "for effect"). B exhibits the attitude of people who
won't take responsibility for their own coding, and expect the compiler
to give them the results they want regardless of what they asked for,
justified with sarcasm rather than logic.

But now at least I know what you mean by a "C++ view of UB" and a "C
view of UB", despite the two languages having an identical concept of UB
and despite them usually being used with exactly the same compiler.

Re: Use Rust instead? (Was Re: Paper about ISO C)

<sl6ubg$ep0$1@newsreader4.netcologne.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21605&group=comp.arch#21605

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-465a-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Use Rust instead? (Was Re: Paper about ISO C)
Date: Mon, 25 Oct 2021 18:51:28 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <sl6ubg$ep0$1@newsreader4.netcologne.de>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<2021Oct23.192433@mips.complang.tuwien.ac.at>
<sl3m7f$11am$1@gioia.aioe.org>
<2021Oct25.181949@mips.complang.tuwien.ac.at>
Injection-Date: Mon, 25 Oct 2021 18:51:28 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-465a-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:465a:0:7285:c2ff:fe6c:992d";
logging-data="15136"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Mon, 25 Oct 2021 18:51 UTC

Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:

> Fortran's touted benefit is that it will
> assume function parameters don't alias. I.e., if you pass overlapping
> parameters, bad things can happen.

You're leaving out some details.

If you have overlapping actual arguments and change one of them,
then bad things can happen. For this to occur, at least one of
them has to be INTENT(INOUT) or no INTENT, which should not happen
in new code.

Changing INTENT(IN) is caught by the compiler.

Re: Paper about ISO C

<2021Oct25.195829@mips.complang.tuwien.ac.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21606&group=comp.arch#21606

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Mon, 25 Oct 2021 17:58:29 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 89
Message-ID: <2021Oct25.195829@mips.complang.tuwien.ac.at>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me> <cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com> <sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org> <2021Oct12.185057@mips.complang.tuwien.ac.at> <jwvzgre88y4.fsf-monnier+comp.arch@gnu.org> <5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com> <sku3dr$1hb$2@dont-email.me> <5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com> <sl3c2g$n4b$1@dont-email.me>
Injection-Info: reader02.eternal-september.org; posting-host="b42143063d551d6dc122d6d7cabeda20";
logging-data="5360"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+sDF/KatYoSUEEL1Um6qq+"
Cancel-Lock: sha1:KmmxN+HKpEMKfqKtJTsRCZJRJkA=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Mon, 25 Oct 2021 17:58 UTC

David Brown <david.brown@hesbynett.no> writes:
>On 23/10/2021 15:56, Quadibloc wrote:
>> and nothing is preventing them from taking the last version
>> of gcc they liked, and maintaining it themselves. They could
>> even issue a language standard for a language which they
>> could call CC (for "Classic C") or something.
>
>Actually, the gcc folks already did that for the "other side". They
>added the "-fwrapv" flag, and the "-fno-strict-aliasing" flag, and the
>"-fno-delete-null-pointer-checks" flag, and probably others.

There's the rub. With the "probably others" you cannot use the
supposed successor of the known-working gcc as a drop-in replacement,
because the supposed successor may fail to work with the old flags.
There may be new flags which make the supposed successor behave as a
drop-in replacement, but for an existing dried-and-cut package this
does not help; it may fail to compile out of the box with the supposed
successor. Also, the new flag for disabling an "optimization" may
appear only several versions after the "optimization" was enabled by
default (this happened for -fwrapv), which means that several gcc
versions may be unusable (and then the next "optimization" without
flag may be in the versions that allow disabling the previous
"optimization" and so on).

At this point the advocates of undefined behaviour tell me that the
right approach is to keep a known-good gcc around, and build the
package with that and distribute it in binary form. Way to go for a
compiler like gcc that was originally intended to advance the cause of
free software (for clang OTOH things may be different).

That being said, recent gcc versions have not exhibited behaviour that
broke something in Gforth by doing something that I consider
inappropriate. gcc-7 got much more aggressive with tail-duplication,
which caused the sanity check in Gforth to disable a very effective
optimization in Gforth, but I consider tail duplication a legitimate
optimization. We found a workaround for that (won't help old gforth
versions, of course; they work, but without the disabled
optimization).

Supposedly the gcc maintainers are now testing new releases on a much
wider code basis, and use that for a conservative approach towards
optimization, and we may be seeing the benefit of that. I.e., maybe
the gcc maintainers have changed their attitude to be more responsible
(at least partially; my last look in the bug tracker was not so
encouraging) than what fans of undefined behaviour advocate.

>They got gcc for free (without
>having to maintain it), and they too could use the "-fwrapv" and
>"-fno-strict-aliasing". Not only would their old broken code still
>work, but they could now be sure that it would continue to work in the
>future, albeit as non-portable code.

If that was guaranteed, I would not complain (well, only that this was
not announced from the start). And gcc could certainly take the
presence of both "-fwrapv" and "-fno-strict-aliasing" as a hint that
the programmer does not want the compiler to assume that the program
does not perform undefined behaviour. Those who want to re-enable
specific assumptions could then list the respective flags, e.g.,
"-fdelete-null-pointer-checks".

Currently Gforth's configure.ac checks whether the C compiler
understands the following flags (and uses all those that the C
compiler understands):

-fno-gcse
-fcaller-saves
-fno-defer-pop
-fno-inline
-fwrapv
-fchar-unsigned
-fno-strict-aliasing
-fno-cse-follow-jumps
-fno-reorder-blocks
-fno-reorder-blocks-and-partition
-fno-toplevel-reorder
-fno-trigraphs
-falign-labels=1
-falign-loops=1
-falign-jumps=1
-fno-delete-null-pointer-checks

Only some of those are for disabling assumptions about undefined
behaviour. But OTOH I think that there are flags for disabling
assumptions that are not included in this list.

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

Re: addressing and protection, was Paper about ISO C

<87tuh4khbt.fsf@localhost>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21608&group=comp.arch#21608

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lyn...@garlic.com (Anne & Lynn Wheeler)
Newsgroups: comp.arch
Subject: Re: addressing and protection, was Paper about ISO C
Date: Mon, 25 Oct 2021 09:57:58 -1000
Organization: Wheeler&Wheeler
Lines: 87
Message-ID: <87tuh4khbt.fsf@localhost>
References: <sjv4u6$37u$1@dont-email.me> <sko85o$1lm$1@dont-email.me>
<skoebt$ven$1@dont-email.me> <skomk6$hb9$1@dont-email.me>
<skpdo5$93r$1@gal.iecc.com>
<7oj1ng1hb9nsuq5rg6ausivk8s03piania@4ax.com>
<skr732$2b7$1@dont-email.me>
<o0n9ng9kh6696spmdpvqghpnuoh7q4o4st@4ax.com>
<sl38mv$ncj$1@dont-email.me>
<1c5f66aa-d42e-45c6-a6a5-2e562aa23caen@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="39f8c56bdb0aebd2619d5a57ba06e003";
logging-data="2300"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18q+fNQM08kl1d9fGAG4aROH6xYMJUDfkg="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:oAQaqCaYWVuR5pbwEvrho0CqzUA=
sha1:CrIJyhTP2UD4aXe86FgAyE+gPKU=
 by: Anne & Lynn Whee - Mon, 25 Oct 2021 19:57 UTC

MitchAlsup <MitchAlsup@aol.com> writes:
> I was a sophomore in an Algebra 2 class comprised of mostly seniors.
> I sat in the back of the room so as to not annoy the seniors. One day I
> was doing Latin homework and not paying any attention, at which time
> the teacher called upon me, I looked at the scribbling on the board and
> emitted the correct answer. The teacher did not bother me again. The
> seniors were both annoyed and amazed.

end of 5th grade there was achievement test that had x+y=3, 2x+y=5,
solve for x and y. this was small rural school system and I had no idea
what it was .. I asked and was told algebra. next time county bookmobile
came through, I checked out algebra book ... by the end of summer had
finished all the school math books the bookmobile had. school system
didn't allow skipping any classes (one exception was physics sophmore
year with seniors, which required that they also be taking senior trig
.... but I had finished senior trig before 6th grade started) ... I did
make cardboard slide rules during 6th grade and by the middle of the
following summer was able to order a $4 sliderule from sears. 8th grade,
read science fiction books during math class, got 100s on everything
except zero for class participation).

In highschool I worked for the local hardware store and would
periodically get loaned out to local contractors. I managed to save
enough money I had enough to start at univ. in the fall. Summer after
freshman year, I got job as foreman on construction job (in part because
I could run the survey instrument, had three nine person crews) ...
spring had been wet and they were way behind schedule and started
working 80+hr weeks (time&half for 41-60, and double time for >60
.... more money/month until a number of years after graduation).

.... took intro to computers/fortran my sophmore year, univ. had 709
tape->tape with 1401 front-end tape<->unit record. End of class, I got
student job rewriting 1401 MPIO for 360/30 (univ. had been sold 360/67
for tss/360 replacing 709/1401 ... 360/30 interim replacing 1401 pending
360/67) ... I got to design & implement my own stand alone monitor,
device drivers, interrupt handlers, error recovery, storage management,
etc (they could have just continued to use MPIO in 1401 emulation on
360/30, but it apparently was part of gaining 360 experience). Univ.
shutdown datacenter on weekends ... and I had the whole place dedicated
to myself for 48hrs straight, although 48hrs w/o sleep made monday
classes a little hard). Within a year of taking computing/fortran intro
class, I was hired fulltime to be responsible for os/360 systems
(tss/360 never came to production fruition so ran as 360/65).

Student fortran jobs had ran less than second on 709 tape->tape
.... initially with os/360 running as 360/65 took over minute. I
installed hasp which cut it in half. I then started doing carefully
crafted SYSGENS for placement of files and PDS members for optimized arm
seeks and multi-track searches ... cutting another 2/3rds to 12.9sec
(student jobs never ran faster than 709 until installed Waterloo's
WATFOR).

Then before I graduate, I'm hired fulltime into a small group in the
Boeing CFO's office to help with the formation of Boeing Computer
Services (consolidate all dataprocessing into an independent business
unit to better monetize the investment, including offering services to
non-Boeing entities). I thot Renton datacenter was possibly largest in
the world, something like $200M-$300M (60s $$$) in IBM 360s, 360/65s
arriving faster than they could be installed, boxes constantly staged in
hallways around machine room. 747-3 was flying skies of seattle getting
FAA flt. certification. Some point at the univ. I had gotten a copy of
Cambridge's (virtual machine) CP67 that I could play with on the
weekends. When I was hired at Boeing, the CFO office just had a small
machine room for 360/30 that was used for the company payroll ... but
they expanded the machine room and installed a 360/67 for me to play
with CP67 as much as I wanted to (when I wasn't doing other stuff). When
I graduate, I join the IBM science center (instead of staying at
Boeing).

Late 70s/early 80s, I was blamed for online computer conferencing on the
internal network (larger than arpanet/internet from just about beginning
until sometime mid/late 80s), folklore is that when corporate executive
committee was told about it, 5of6 wanted to fire me (some claim that
some 25,000 employees were reading, even tho only about 300 were
participating). One of the outcomes was researcher was paid to study
how I communicate, sat in the back of my office for 9months taking notes
on how I communicated, went with me to meetings, got copies of all
incoming & outgoing email and logs of all instant messages. Results were
papers, books, and Stanford Phd (joint language & computer ai, winograd
was advisor on computer at side). The researcher had spent several
years as ESL instructor ... and commented that my use of English is
characteristic of non-native speaker (fluent in some other language)
.... except I have no non-English native (natural) language.

--
virtualization experience starting Jan1968, online at home since Mar1970

Re: addressing and protection, was Paper about ISO C

<sl72km$1on8$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21609&group=comp.arch#21609

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!aioe.org!ppYixYMWAWh/woI8emJOIQ.user.46.165.242.91.POSTED!not-for-mail
From: terje.ma...@tmsw.no (Terje Mathisen)
Newsgroups: comp.arch
Subject: Re: addressing and protection, was Paper about ISO C
Date: Mon, 25 Oct 2021 22:04:38 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sl72km$1on8$1@gioia.aioe.org>
References: <sjv4u6$37u$1@dont-email.me> <sko85o$1lm$1@dont-email.me>
<skoebt$ven$1@dont-email.me> <skomk6$hb9$1@dont-email.me>
<skpdo5$93r$1@gal.iecc.com> <7oj1ng1hb9nsuq5rg6ausivk8s03piania@4ax.com>
<skr732$2b7$1@dont-email.me> <o0n9ng9kh6696spmdpvqghpnuoh7q4o4st@4ax.com>
<sl38mv$ncj$1@dont-email.me>
<1c5f66aa-d42e-45c6-a6a5-2e562aa23caen@googlegroups.com>
<sl4fg6$15f$1@dont-email.me>
<d32e7fd7-0131-4ebb-891b-fa1da6473fb2n@googlegroups.com>
<sl4n8i$kt$1@dont-email.me> <sl5qi9$nf6$1@gioia.aioe.org>
<86czntgf6p.fsf@linuxsc.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="58088"; posting-host="ppYixYMWAWh/woI8emJOIQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101
Firefox/60.0 SeaMonkey/2.53.9.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: Terje Mathisen - Mon, 25 Oct 2021 20:04 UTC

Tim Rentsch wrote:
> Terje Mathisen <terje.mathisen@tmsw.no> writes:
>
>> Ivan Godard wrote:
>>
>>> Here's a quick one, looks like an algebra problem but is actually
>>> for 3D visualization. It was on a scholarship test, and we later
>>> used it in recruiting at PDC:
>>>
>>> Given a cube, one on a side. Inscribed sphere, tangent to the cube's
>>> faces. In each corner an inscribed sphere, tangent to the three cube
>>> faces and the central sphere. What is the volume of the cube not
>>> occupied by the spheres?
>>
>> That seemed really hard, but I'm pretty sure it helps a lot to realize
>> that each of those smaller corner spheres can have a smaller cube
>> around it, and that three of those cube faces will overlap with the
>> larger cube. This means that first, the diagonal distance from the
>> large sphere to a corner will be (3^-3 - 1)/2, or about 0.22.
>
> Of course you mean sqrt(3), not 3**-3 or 3**(1./3.)

Oops... :-(

>> That
>> distance will then be split by a small sphere with the same ratio from
>> center to corner, or (1+power(3,1/3)) * (-1+power(3,1/3)) / 4.
>>
>> Am I on the right track?
>
> Here is how I reasoned it.
>
> First I considered just one corner of the cube, with a unit
> sphere (so radius one) inside, rather than a unit cube (so
> in my case the cube is 2x2x2, but one corner of it is 1x1x1).

I did the same, then I noticed that I had to divide by 2.

Terje

--
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

Re: Paper about ISO C

<sl79bl$jei$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21610&group=comp.arch#21610

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Mon, 25 Oct 2021 23:59:16 +0200
Organization: A noiseless patient Spider
Lines: 186
Message-ID: <sl79bl$jei$1@dont-email.me>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 25 Oct 2021 21:59:17 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a5438c96186927b7a6a5f2a6654af5ec";
logging-data="19922"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Q3J87bc0OxRA9bqloTdIYxcbSl9u3dqI="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:Qw/LNVNW1q/1doCpj9K3LRrwiVI=
In-Reply-To: <2021Oct25.195829@mips.complang.tuwien.ac.at>
Content-Language: en-GB
 by: David Brown - Mon, 25 Oct 2021 21:59 UTC

On 25/10/2021 19:58, Anton Ertl wrote:
> David Brown <david.brown@hesbynett.no> writes:
>> On 23/10/2021 15:56, Quadibloc wrote:
>>> and nothing is preventing them from taking the last version
>>> of gcc they liked, and maintaining it themselves. They could
>>> even issue a language standard for a language which they
>>> could call CC (for "Classic C") or something.
>>
>> Actually, the gcc folks already did that for the "other side". They
>> added the "-fwrapv" flag, and the "-fno-strict-aliasing" flag, and the
>> "-fno-delete-null-pointer-checks" flag, and probably others.
>
> There's the rub. With the "probably others" you cannot use the
> supposed successor of the known-working gcc as a drop-in replacement,
> because the supposed successor may fail to work with the old flags.

Actually, you /can/ - you do so by writing code that has defined
behaviour (defined by the C standard, target ABI, compiler
documentation, etc.).

Where you get in trouble is if you rely on behaviour that is not defined
anywhere and expect it to stay consistent.

I think the scope for that is getting smaller - the big issues that crop
up regularly have already been covered by the flags listed above.

I can only really think of two remaining situation where people could
reasonably assume certain behaviour, but it is not actually guaranteed
by the standards or the compiler - boundary points between functions,
and boundary points across compilation units.

Some people assume that functions are compiled independently, and this
enforces ordering on execution, memory accesses, etc. They think that
if a function calls another function, then that call acts like a memory
barrier of some sort. But of course that is not the case - the compiler
can, for example, assume that the called function does not access any
local variables that don't "escape", and if it can see the function
definition at compilation time, it can inline the code or do all sorts
of re-arrangements and optimisations. I don't know any gcc flags that
blacklist inter-procedural optimisations specifically - there are lots
of "ipa" optimisation flags, many enabled at -O1.

Secondly, many more people will assume that if the functions are in
different compilation units, then they are compiled independently. This
is more often the case - but if you have link-time optimisation (a
technology that has been used in compilers for at least three decades,
so it is not new) then you get inter-procedural optimisations just as if
they were in the same file.

> There may be new flags which make the supposed successor behave as a
> drop-in replacement, but for an existing dried-and-cut package this
> does not help; it may fail to compile out of the box with the supposed
> successor. Also, the new flag for disabling an "optimization" may
> appear only several versions after the "optimization" was enabled by
> default (this happened for -fwrapv), which means that several gcc
> versions may be unusable (and then the next "optimization" without
> flag may be in the versions that allow disabling the previous
> "optimization" and so on).
>
> At this point the advocates of undefined behaviour tell me that the
> right approach is to keep a known-good gcc around, and build the
> package with that and distribute it in binary form. Way to go for a
> compiler like gcc that was originally intended to advance the cause of
> free software (for clang OTOH things may be different).
>

Ultimately, the only way to be /completely/ sure is to be specific about
the compiler.

In my business - small-systems embedded programming - it is important to
be sure. I leave as little to chance or variation as possible. Thus I
write my code to avoid undefined behaviour (as best I can as a mere
human programmer), use as much static error checking, test as well as I
can, etc. But I also consider the toolchain as part of the project and
archive it. That way I can always re-create a bit-perfect copy of the
binary when resurrecting old projects. Embedded compilers and libraries
don't always have the same level of testing and stability as heavily
used desktop tools, so this avoids introducing the risk of new bugs,
regressions in efficiency, or changes in the details of extensions. And
if I /have/ made a mistake and my code is accidentally dependent on the
luck of how some UB is implemented, the results will be consistently lucky!

Obviously, however, that is not appropriate for all kinds of programming
tasks. When you don't have such control, you have a greater
responsibility to make sure your code doesn't attempt to execute UB and
that non-portable code is limited to things that are reasonable.
Sometimes it can be appropriate to add things like pragmas to enable
-fwrapv or -fno-strict-aliasing - that is more robust than demanding
particular compiler flags from the build system.

> That being said, recent gcc versions have not exhibited behaviour that
> broke something in Gforth by doing something that I consider
> inappropriate. gcc-7 got much more aggressive with tail-duplication,
> which caused the sanity check in Gforth to disable a very effective
> optimization in Gforth, but I consider tail duplication a legitimate
> optimization. We found a workaround for that (won't help old gforth
> versions, of course; they work, but without the disabled
> optimization).
>

I appreciate that something like Gforth could be a particularly awkward
kind of program where particular code generation techniques or
optimisations might have a negative effect.

> Supposedly the gcc maintainers are now testing new releases on a much
> wider code basis, and use that for a conservative approach towards
> optimization, and we may be seeing the benefit of that. I.e., maybe
> the gcc maintainers have changed their attitude to be more responsible
> (at least partially; my last look in the bug tracker was not so
> encouraging) than what fans of undefined behaviour advocate.
>

My understanding is that the gcc team (and testers) have done a lot of
wide testing for a long time now, including builds of everything in the
Debian repositories. A lot of the more publicised cases of unexpected
optimisations have come during pre-release testing - which is precisely
why they do pre-release testing.

>> They got gcc for free (without
>> having to maintain it), and they too could use the "-fwrapv" and
>> "-fno-strict-aliasing". Not only would their old broken code still
>> work, but they could now be sure that it would continue to work in the
>> future, albeit as non-portable code.
>
> If that was guaranteed, I would not complain (well, only that this was
> not announced from the start). And gcc could certainly take the
> presence of both "-fwrapv" and "-fno-strict-aliasing" as a hint that
> the programmer does not want the compiler to assume that the program
> does not perform undefined behaviour. Those who want to re-enable
> specific assumptions could then list the respective flags, e.g.,
> "-fdelete-null-pointer-checks".

I think it is probably impossible to have a compiler that does not make
some assumptions about the non-execution of UB. To take an obvious
example, if you define a function in one unit with a particular set of
parameters, then declare it and call it in a different unit with a
different set of parameters, it is UB. A compiler will obviously assume
that when you declare a function and call it, that the function really
takes those parameter types - it is assuming that such UB does not occur.

There are specific examples of UB where there is a particular
interpretation that people could reasonably expect if the behaviour had
been defined. TBAA violations are a fine example. Signed integer
overflow is another, though less clear - I am not inclined to accept a
clearly wrong answer as an "obvious" interpretation. However, you can
certainly argue that these, along with things like certain shifts of
negative values, could all be grouped under one "-fdefine-some-ub" flag.

But UB in general would still exist, and the compiler must be able to
assume that UB does not occur. What you are doing is /not/ restricting
optimisation based on UB, but instead adding additional semantics to the
language for certain aspects, giving defined behaviour to particular
things that the language standard leaves as UB. I have no problem with
that.

>
> Currently Gforth's configure.ac checks whether the C compiler
> understands the following flags (and uses all those that the C
> compiler understands):
>
> -fno-gcse
> -fcaller-saves
> -fno-defer-pop
> -fno-inline
> -fwrapv
> -fchar-unsigned
> -fno-strict-aliasing
> -fno-cse-follow-jumps
> -fno-reorder-blocks
> -fno-reorder-blocks-and-partition
> -fno-toplevel-reorder
> -fno-trigraphs
> -falign-labels=1
> -falign-loops=1
> -falign-jumps=1
> -fno-delete-null-pointer-checks
>
> Only some of those are for disabling assumptions about undefined
> behaviour. But OTOH I think that there are flags for disabling
> assumptions that are not included in this list.
>


Click here to read the complete article
Re: Paper about ISO C

<jwvh7d4twhd.fsf-monnier+comp.arch@gnu.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21613&group=comp.arch#21613

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: monn...@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Mon, 25 Oct 2021 21:30:41 -0400
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <jwvh7d4twhd.fsf-monnier+comp.arch@gnu.org>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me>
<jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me>
<2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl79bl$jei$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="ddf27eb5cba67a29c2eeb71d25e12f01";
logging-data="14445"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/79+FSXvv1lI8zvlO71Ojg"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Cancel-Lock: sha1:Aeat+WqsWBto60Fi+ZkqlZjxl3M=
sha1:H3+iACrCWkY2ePT/l7tD9nU3r8I=
 by: Stefan Monnier - Tue, 26 Oct 2021 01:30 UTC

David Brown [2021-10-25 23:59:16] wrote:
> On 25/10/2021 19:58, Anton Ertl wrote:
>> David Brown <david.brown@hesbynett.no> writes:
>>> On 23/10/2021 15:56, Quadibloc wrote:
>>>> and nothing is preventing them from taking the last version
>>>> of gcc they liked, and maintaining it themselves. They could
>>>> even issue a language standard for a language which they
>>>> could call CC (for "Classic C") or something.
>>>
>>> Actually, the gcc folks already did that for the "other side". They
>>> added the "-fwrapv" flag, and the "-fno-strict-aliasing" flag, and the
>>> "-fno-delete-null-pointer-checks" flag, and probably others.
>>
>> There's the rub. With the "probably others" you cannot use the
>> supposed successor of the known-working gcc as a drop-in replacement,
>> because the supposed successor may fail to work with the old flags.
>
> Actually, you /can/ - you do so by writing code that has defined
> behaviour (defined by the C standard, target ABI, compiler
> documentation, etc.).

Sometimes it's not an option. To mention an example I brought up here
a few times, AFAIK you can't write code which scans the stack.
This is inherently an operation whose result can't be strictly defined
by the standard, but the problem is that it means you're necessarily at
the mercy of the compiler.

Such code is rare and we can mostly make it work with current compilers,
but it would be nice to have some way to tell the compiler that this is
UB-on-purpose and hence optimizations shouldn't presume that UB is
impossible on that code.

Of course, that won't be sufficient to give the code a meaningful and
reliable semantics: after all, the compiler may decide to use multiple
stacks, divided into multiple small chunks, and it may decide to
represent its stack in any kind of creative way. These are really
fundamentally "undefined" and inherently depend on the compiler's
internals. But being able to write the loop that scans between the two
pointers which we think represent the top and bottom of the stack would
be a good step.

Stefan

Re: Specifying timing constraints was Re: Paper about ISO C

<d056984b-4bed-479c-b2ff-b67914f8b65cn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21614&group=comp.arch#21614

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:8287:: with SMTP id e129mr17699051qkd.415.1635227826161;
Mon, 25 Oct 2021 22:57:06 -0700 (PDT)
X-Received: by 2002:a4a:c509:: with SMTP id i9mr15741954ooq.21.1635227825839;
Mon, 25 Oct 2021 22:57:05 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Mon, 25 Oct 2021 22:57:05 -0700 (PDT)
In-Reply-To: <sl32ot$qn1$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:fa3a:e00:a59b:23d4:956c:bcbe;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:fa3a:e00:a59b:23d4:956c:bcbe
References: <87fstdumxd.fsf@hotmail.com> <afb9352d-8ba7-4521-b741-280e0206e255n@googlegroups.com>
<3a350cfe-971c-4042-9171-9ec2516cdf2bn@googlegroups.com> <sk6s4a$9cm$1@dont-email.me>
<1ed391dc-0d1d-4069-96d8-e83acbe01ba5n@googlegroups.com> <sk9ej9$fj9$1@dont-email.me>
<jwvtuhj4dlq.fsf-monnier+comp.arch@gnu.org> <skc7a9$698$1@dont-email.me>
<skc905$85c$1@dont-email.me> <skh20o$ji2$1@dont-email.me> <4fc4f707-2d42-492a-bd41-f791141dbfb2n@googlegroups.com>
<skhjk3$9p4$1@dont-email.me> <f9db2e75-2ec2-4572-b211-a8b2d6b3e0e6n@googlegroups.com>
<skjkqv$nd3$1@dont-email.me> <0ba079c3-d672-47b3-b86d-cfc74520ca5dn@googlegroups.com>
<86a6j6l8ci.fsf@linuxsc.com> <LClbJ.602$xjIc.241@fx01.iad>
<skl12c$i1n$1@dont-email.me> <qgDbJ.3$in7.0@fx22.iad> <skn1iv$ap3$1@dont-email.me>
<skn3ib$ouk$1@dont-email.me> <86ilxnii8c.fsf@linuxsc.com> <sl20bg$uha$1@dont-email.me>
<sl32ot$qn1$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d056984b-4bed-479c-b2ff-b67914f8b65cn@googlegroups.com>
Subject: Re: Specifying timing constraints was Re: Paper about ISO C
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Tue, 26 Oct 2021 05:57:06 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Quadibloc - Tue, 26 Oct 2021 05:57 UTC

On Sunday, October 24, 2021 at 1:42:23 AM UTC-6, Thomas Koenig wrote:
> Ivan Godard <iv...@millcomputing.com> schrieb:
> > The lit history is full of efforts to put units into the type systems.
> > They sure look plausible but don't work. Think of a NR sqrt routine.

> MathCad has got this right. It is not a compiled language,
> but it certainly works. I use it a lot in my day job for simple
> engineering calculations: You see the formulas, you immediately
> see the output, you do input in units (like kg/h), you can convert
> the output to units you want.
>
> And, of course, it complains if you try to add or subtract
> dimensions that do not match.
>
> (Notice I said "dimensions" in the last sentence - adding an inch
> to a meter is fine, because both get converted automatically,
> but adding a meter to a second is an error. Nomenclature:
> Length is a dimension, meter or inch are units, of length
> in this case).
>
> It even handles square roots of units and dimensions, which
> are sometimes used, as characteristics of distillations colums,
> for example.
>
> It handles units and dimensions as floating point numbers.
> For dimensions, using rational numbers would probably be better.

This is interesting; I am glad to hear that a language is available
that can handle physical quantities with units correctly, thus
reducing problems created by mistakes in dimensional analysis
by the programmer.

And given that statement of the _benefit_ of doing this, I think
that one _could_ in a compiled language flag floating-point
quantities with units, so that the compiler would give an error or
warning if incorrect arithmetic operations were specified with them.

This reminds me: on my web site, in my description of a
proposed language, I've proposed an extension to the type
system for languages like FORTRAN that are used for numerical
computation.

The language is based on one I'd come up with many years ago
back when I was a student in University. It was basically a fancy
Fortran with additional ease of use features.

So if A, B, and C are arrays, one could write A=B+C or A=B*C
instead of having to write a DO loop.

I spoke to someone else about it, and I noted that A=B*C was
element-by-element, not matrix multiplication, in response to
a question. The other fellow thought I was being too slavish
in following APL.

I thought about the matter further.

I felt I _was_ right in handling _arrays_ that way. Making matrix
multiplication the default for multiplying arrays was giving
inappropriate semantic content to the notion of an array.

But I felt the other fellow had a point too. Matrix multiplication
is important in scientific and engineering computation.

So I came up with what was, to me, a solution.

In FORTRAN, there is a COMPLEX data type. In my language,
I had already added, as an obvious extension, a QUATERNION
data type.

Well, then.

What about a MATRIX data type?

Given that a MATRIX would bind an a x b grid of scalar
elements into a *mathematical object* which would be
subject to special rules and operations, whereas a two-dimensional
array is just a plain collection of things, you can have an array of
matrices, but *not* a matrix of arrays (basically for the same
reason you can't have a complex number whose real and imaginary
parts are each an array with the same dimensions).

This makes sense to me, but apparently to no one else, as it
has yet to catch the world by storm.

John Savard

Re: Specifying timing constraints was Re: Paper about ISO C

<sl86pl$bgi$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21616&group=comp.arch#21616

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: sfu...@alumni.cmu.edu.invalid (Stephen Fuld)
Newsgroups: comp.arch
Subject: Re: Specifying timing constraints was Re: Paper about ISO C
Date: Mon, 25 Oct 2021 23:21:39 -0700
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <sl86pl$bgi$1@dont-email.me>
References: <87fstdumxd.fsf@hotmail.com>
<afb9352d-8ba7-4521-b741-280e0206e255n@googlegroups.com>
<3a350cfe-971c-4042-9171-9ec2516cdf2bn@googlegroups.com>
<sk6s4a$9cm$1@dont-email.me>
<1ed391dc-0d1d-4069-96d8-e83acbe01ba5n@googlegroups.com>
<sk9ej9$fj9$1@dont-email.me> <jwvtuhj4dlq.fsf-monnier+comp.arch@gnu.org>
<skc7a9$698$1@dont-email.me> <skc905$85c$1@dont-email.me>
<skh20o$ji2$1@dont-email.me>
<4fc4f707-2d42-492a-bd41-f791141dbfb2n@googlegroups.com>
<skhjk3$9p4$1@dont-email.me>
<f9db2e75-2ec2-4572-b211-a8b2d6b3e0e6n@googlegroups.com>
<skjkqv$nd3$1@dont-email.me>
<0ba079c3-d672-47b3-b86d-cfc74520ca5dn@googlegroups.com>
<86a6j6l8ci.fsf@linuxsc.com> <LClbJ.602$xjIc.241@fx01.iad>
<skl12c$i1n$1@dont-email.me> <qgDbJ.3$in7.0@fx22.iad>
<skn1iv$ap3$1@dont-email.me> <skn3ib$ouk$1@dont-email.me>
<86ilxnii8c.fsf@linuxsc.com> <sl20bg$uha$1@dont-email.me>
<sl32ot$qn1$1@newsreader4.netcologne.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Oct 2021 06:21:41 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="cc4b31de3538b1f11b7518a25ea23c3f";
logging-data="11794"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ZjWaDS6sMQmng/7cjFwBWfsPAcSwWZIc="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.2.1
Cancel-Lock: sha1:MkkJlgKWTfr1FlsNNWIMKRP63w0=
In-Reply-To: <sl32ot$qn1$1@newsreader4.netcologne.de>
Content-Language: en-US
 by: Stephen Fuld - Tue, 26 Oct 2021 06:21 UTC

On 10/24/2021 12:42 AM, Thomas Koenig wrote:
> Ivan Godard <ivan@millcomputing.com> schrieb:
>
>> The lit history is full of efforts to put units into the type systems.
>> They sure look plausible but don't work. Think of a NR sqrt routine.
>
> MathCad has got this right. It is not a compiled language,
> but it certainly works. I use it a lot in my day job for simple
> engineering calculations: You see the formulas, you immediately
> see the output, you do input in units (like kg/h), you can convert
> the output to units you want.
>
> And, of course, it complains if you try to add or subtract
> dimensions that do not match.

What happens if you multiply two variables with dimension "length"
together? Does it understand that the result is an "area"? And that is
a simple case. You can get far more complex combinations than that. It
seems to me that this could be a nearly bottomless pit.

--
- Stephen Fuld
(e-mail address disguised to prevent spam)

Re: Specifying timing constraints was Re: Paper about ISO C

<836726a6-3bda-40ec-9063-fad3e18d0c51n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21618&group=comp.arch#21618

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:c83:: with SMTP id 125mr17857085qkm.453.1635231176011;
Mon, 25 Oct 2021 23:52:56 -0700 (PDT)
X-Received: by 2002:a05:6808:10e:: with SMTP id b14mr453582oie.44.1635231175703;
Mon, 25 Oct 2021 23:52:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch
Date: Mon, 25 Oct 2021 23:52:55 -0700 (PDT)
In-Reply-To: <sl86pl$bgi$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:56a:fa3a:e00:a59b:23d4:956c:bcbe;
posting-account=1nOeKQkAAABD2jxp4Pzmx9Hx5g9miO8y
NNTP-Posting-Host: 2001:56a:fa3a:e00:a59b:23d4:956c:bcbe
References: <87fstdumxd.fsf@hotmail.com> <afb9352d-8ba7-4521-b741-280e0206e255n@googlegroups.com>
<3a350cfe-971c-4042-9171-9ec2516cdf2bn@googlegroups.com> <sk6s4a$9cm$1@dont-email.me>
<1ed391dc-0d1d-4069-96d8-e83acbe01ba5n@googlegroups.com> <sk9ej9$fj9$1@dont-email.me>
<jwvtuhj4dlq.fsf-monnier+comp.arch@gnu.org> <skc7a9$698$1@dont-email.me>
<skc905$85c$1@dont-email.me> <skh20o$ji2$1@dont-email.me> <4fc4f707-2d42-492a-bd41-f791141dbfb2n@googlegroups.com>
<skhjk3$9p4$1@dont-email.me> <f9db2e75-2ec2-4572-b211-a8b2d6b3e0e6n@googlegroups.com>
<skjkqv$nd3$1@dont-email.me> <0ba079c3-d672-47b3-b86d-cfc74520ca5dn@googlegroups.com>
<86a6j6l8ci.fsf@linuxsc.com> <LClbJ.602$xjIc.241@fx01.iad>
<skl12c$i1n$1@dont-email.me> <qgDbJ.3$in7.0@fx22.iad> <skn1iv$ap3$1@dont-email.me>
<skn3ib$ouk$1@dont-email.me> <86ilxnii8c.fsf@linuxsc.com> <sl20bg$uha$1@dont-email.me>
<sl32ot$qn1$1@newsreader4.netcologne.de> <sl86pl$bgi$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <836726a6-3bda-40ec-9063-fad3e18d0c51n@googlegroups.com>
Subject: Re: Specifying timing constraints was Re: Paper about ISO C
From: jsav...@ecn.ab.ca (Quadibloc)
Injection-Date: Tue, 26 Oct 2021 06:52:56 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 15
 by: Quadibloc - Tue, 26 Oct 2021 06:52 UTC

On Tuesday, October 26, 2021 at 12:21:43 AM UTC-6, Stephen Fuld wrote:

> What happens if you multiply two variables with dimension "length"
> together? Does it understand that the result is an "area"? And that is
> a simple case. You can get far more complex combinations than that. It
> seems to me that this could be a nearly bottomless pit.

Well, since things like kg-m/sec^2 are valid dimensions, presumably
multiplying and dividing dimensions is okay. You just get a combination
of dimensions, and then you can only add or subtract it to something with
the same combination.

But only dimensionless numbers could be raised to powers that weren't
integer constants... that limitation should avoid the really bad problems.

John Savard

Re: Paper about ISO C

<sl8a91$ul2$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21619&group=comp.arch#21619

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Tue, 26 Oct 2021 09:21:05 +0200
Organization: A noiseless patient Spider
Lines: 72
Message-ID: <sl8a91$ul2$1@dont-email.me>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl79bl$jei$1@dont-email.me> <jwvh7d4twhd.fsf-monnier+comp.arch@gnu.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Oct 2021 07:21:05 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="fa9dd796f275214ccb741419f69175be";
logging-data="31394"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18iWi+Y52RzoRwhP0UPzTLlV+1y0otqcWE="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:hCbt+GpMsmR4yPTXEpoAp1P7I00=
In-Reply-To: <jwvh7d4twhd.fsf-monnier+comp.arch@gnu.org>
Content-Language: en-GB
 by: David Brown - Tue, 26 Oct 2021 07:21 UTC

On 26/10/2021 03:30, Stefan Monnier wrote:
> David Brown [2021-10-25 23:59:16] wrote:
>> On 25/10/2021 19:58, Anton Ertl wrote:
>>> David Brown <david.brown@hesbynett.no> writes:
>>>> On 23/10/2021 15:56, Quadibloc wrote:
>>>>> and nothing is preventing them from taking the last version
>>>>> of gcc they liked, and maintaining it themselves. They could
>>>>> even issue a language standard for a language which they
>>>>> could call CC (for "Classic C") or something.
>>>>
>>>> Actually, the gcc folks already did that for the "other side". They
>>>> added the "-fwrapv" flag, and the "-fno-strict-aliasing" flag, and the
>>>> "-fno-delete-null-pointer-checks" flag, and probably others.
>>>
>>> There's the rub. With the "probably others" you cannot use the
>>> supposed successor of the known-working gcc as a drop-in replacement,
>>> because the supposed successor may fail to work with the old flags.
>>
>> Actually, you /can/ - you do so by writing code that has defined
>> behaviour (defined by the C standard, target ABI, compiler
>> documentation, etc.).
>
> Sometimes it's not an option. To mention an example I brought up here
> a few times, AFAIK you can't write code which scans the stack.
> This is inherently an operation whose result can't be strictly defined
> by the standard, but the problem is that it means you're necessarily at
> the mercy of the compiler.
>

Code like that has to be specific to the particular compiler and often
to particular versions and flag sets. Eventually you can reach a point
where the code is "defined" in terms of what you see it has produced.
(I suppose someone could write a non-deterministic compiler, but that
might be an unpopular choice!)

> Such code is rare and we can mostly make it work with current compilers,
> but it would be nice to have some way to tell the compiler that this is
> UB-on-purpose and hence optimizations shouldn't presume that UB is
> impossible on that code.
>

That can't happen, in general. The best you can do is give defined
behaviours to some specific classes of UB. You can say, for example,
that all memory accesses should be treated as "volatile". (Of course,
you can do that anyway - if you want some memory accesses to be handled
"exactly as you write", then make them volatile.) Or you can say that
you want all signed overflow to be wrapping (you can use casts to
unsigned for that).

The closest you can get, perhaps, would be to add "#pragma GCC optimize
0" to the code to disable all optimisations in that part.

> Of course, that won't be sufficient to give the code a meaningful and
> reliable semantics: after all, the compiler may decide to use multiple
> stacks, divided into multiple small chunks, and it may decide to
> represent its stack in any kind of creative way. These are really
> fundamentally "undefined" and inherently depend on the compiler's
> internals. But being able to write the loop that scans between the two
> pointers which we think represent the top and bottom of the stack would
> be a good step.
>

A couple of "volatile" qualifiers on your pointers should handle that
nicely. (But as you say, it won't guarantee that things are put on the
stack in the way you might expect.)

To be fair, I suppose, the meaning of using "pointer to volatile"
pointers has been poorly defined in C - it is not until the upcoming C23
that "volatile semantics for lvalues" is actually standardised.
However, all known compilers have always treated accesses using volatile
pointers as "non-optimised".

Re: Paper about ISO C

<itpou1Fa8stU1@mid.individual.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21621&group=comp.arch#21621

  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.h...@tidorum.invalid (Niklas Holsti)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Tue, 26 Oct 2021 10:26:57 +0300
Organization: Tidorum Ltd
Lines: 40
Message-ID: <itpou1Fa8stU1@mid.individual.net>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl79bl$jei$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net X86xbfyWBNgr7dRhDUszHQhyM1VFld8xXf+DKLh42SrA+Sy/vv
Cancel-Lock: sha1:s4mE5MWVYpkn8nLwX31UzLsR4y8=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0)
Gecko/20100101 Thunderbird/78.14.0
In-Reply-To: <sl79bl$jei$1@dont-email.me>
Content-Language: en-US
 by: Niklas Holsti - Tue, 26 Oct 2021 07:26 UTC

On 2021-10-26 0:59, David Brown wrote:

> I can only really think of two remaining situation where people could
> reasonably assume certain behaviour, but it is not actually guaranteed
> by the standards or the compiler - boundary points between functions,
> and boundary points across compilation units.
>
> Some people assume that functions are compiled independently, and this
> enforces ordering on execution, memory accesses, etc. They think that
> if a function calls another function, then that call acts like a memory
> barrier of some sort. But of course that is not the case -

These discussions of volatile, and execution order wrt timing, gave me
an idea: perhaps C (and other languages) should allow marking functions
(subprograms) as "volatile", with the meaning that all of the effects of
a call of that function (including use of processor time) should be
ordered as volatile accesses are ordered, with respect to other volatile
accesses.

For example, if x and y are volatile variables, and foo is a volatile
function, then in this code

x = 1;
foo ();
y = 1;

we would be sure that all effects and all dynamic resource usage of the
foo() call would occur between the assignments to x and to y.

A more flexible approach would be to mark selected function calls as
volatile, in the same way that C allows in-line use of
pointer-to-volatile to force a volatile access to an object that is not
itself marked volatile. Something like:

x = 1;
(volatile) foo ();
y = 1;

Are volatile functions and/or volatile function calls a good idea?

Re: Paper about ISO C

<sl8m0n$ipt$1@newsreader4.netcologne.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21624&group=comp.arch#21624

  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-465a-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Tue, 26 Oct 2021 10:41:27 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <sl8m0n$ipt$1@newsreader4.netcologne.de>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
Injection-Date: Tue, 26 Oct 2021 10:41:27 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-465a-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:465a:0:7285:c2ff:fe6c:992d";
logging-data="19261"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Tue, 26 Oct 2021 10:41 UTC

Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:

> Currently Gforth's configure.ac checks whether the C compiler
> understands the following flags (and uses all those that the C
> compiler understands):
>
> -fno-gcse
> -fcaller-saves
> -fno-defer-pop
> -fno-inline
> -fwrapv
> -fchar-unsigned
> -fno-strict-aliasing
> -fno-cse-follow-jumps
> -fno-reorder-blocks
> -fno-reorder-blocks-and-partition
> -fno-toplevel-reorder
> -fno-trigraphs
> -falign-labels=1
> -falign-loops=1
> -falign-jumps=1
> -fno-delete-null-pointer-checks

Wow.

-fno-reorder-blocks puts the compiler back before the very first
FORTRAN compiler, which invented basic blocks and moving them
around for optimization.

-fno-inline can be a performance killer if people prefer static
inline functions, which are type-safe and evaluate their arguments
only once over macros.

But then, I understand from an old PR of yours (PR 15252) that
gforth makes heavy use of "goto variable", an extension that
(IIRC) was originally put into gcc by Craig Burley to support
assigned gotos in FORTRAN, so your code is certainly very much
non-conforming. Luckily, assigned gotos have been depecated
in Fortran.

For the readers who do not know what I am talking about,
here is a reduced test case from the PR:

int f(int i, int j)
{ static void *a[5] = {&&b,&&c,&&d,&&e,&&f};

if (i >=5) i = 0; if (i<=0)i=5;
goto *a[i];
e:
i++; if (i >=5) i = 0; if (i<=0)i=5;
j++;
goto *a[i];
f:
i--; if (i >=5) i = 0; if (i<=0)i=5;
j--;
goto *a[i];
b:
i+=2; if (i >=5) i = 0; if (i<=0)i=5;
goto *a[i];
c:
i*=2; if (i >=5) i = 0; if (i<=0)i=5;
goto *a[i];
d:;
}

With this sort of code, I can understand why a lot of optimizations
like moving basic blocks around can mess up your implementation.

> Only some of those are for disabling assumptions about undefined
> behaviour.

I suspect the rest is for making code like the above work :-)

Re: Paper about ISO C

<sl8m4t$ipt$2@newsreader4.netcologne.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21625&group=comp.arch#21625

  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-465a-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Paper about ISO C
Date: Tue, 26 Oct 2021 10:43:41 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <sl8m4t$ipt$2@newsreader4.netcologne.de>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<sl3c2g$n4b$1@dont-email.me> <2021Oct25.195829@mips.complang.tuwien.ac.at>
<sl79bl$jei$1@dont-email.me> <itpou1Fa8stU1@mid.individual.net>
Injection-Date: Tue, 26 Oct 2021 10:43:41 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-465a-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:465a:0:7285:c2ff:fe6c:992d";
logging-data="19261"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Tue, 26 Oct 2021 10:43 UTC

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

> For example, if x and y are volatile variables, and foo is a volatile
> function, then in this code
>
> x = 1;
> foo ();
> y = 1;
>
> we would be sure that all effects and all dynamic resource usage of the
> foo() call would occur between the assignments to x and to y.

You can have that already by having pointers to x and y escape
(i.e. put bar(&x, &y) before it).

If the compiler cannot determine that foo() does not touch these
variables, then the order is assured.

(And no, I am not a fan of that particular feature of C).

Re: Specifying timing constraints was Re: Paper about ISO C

<sl8mc4$ipt$3@newsreader4.netcologne.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21626&group=comp.arch#21626

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-465a-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Specifying timing constraints was Re: Paper about ISO C
Date: Tue, 26 Oct 2021 10:47:32 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <sl8mc4$ipt$3@newsreader4.netcologne.de>
References: <87fstdumxd.fsf@hotmail.com>
<afb9352d-8ba7-4521-b741-280e0206e255n@googlegroups.com>
<3a350cfe-971c-4042-9171-9ec2516cdf2bn@googlegroups.com>
<sk6s4a$9cm$1@dont-email.me>
<1ed391dc-0d1d-4069-96d8-e83acbe01ba5n@googlegroups.com>
<sk9ej9$fj9$1@dont-email.me> <jwvtuhj4dlq.fsf-monnier+comp.arch@gnu.org>
<skc7a9$698$1@dont-email.me> <skc905$85c$1@dont-email.me>
<skh20o$ji2$1@dont-email.me>
<4fc4f707-2d42-492a-bd41-f791141dbfb2n@googlegroups.com>
<skhjk3$9p4$1@dont-email.me>
<f9db2e75-2ec2-4572-b211-a8b2d6b3e0e6n@googlegroups.com>
<skjkqv$nd3$1@dont-email.me>
<0ba079c3-d672-47b3-b86d-cfc74520ca5dn@googlegroups.com>
<86a6j6l8ci.fsf@linuxsc.com> <LClbJ.602$xjIc.241@fx01.iad>
<skl12c$i1n$1@dont-email.me> <qgDbJ.3$in7.0@fx22.iad>
<skn1iv$ap3$1@dont-email.me> <skn3ib$ouk$1@dont-email.me>
<86ilxnii8c.fsf@linuxsc.com> <sl20bg$uha$1@dont-email.me>
<sl32ot$qn1$1@newsreader4.netcologne.de> <sl86pl$bgi$1@dont-email.me>
Injection-Date: Tue, 26 Oct 2021 10:47:32 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-465a-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:465a:0:7285:c2ff:fe6c:992d";
logging-data="19261"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Tue, 26 Oct 2021 10:47 UTC

Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb:
> On 10/24/2021 12:42 AM, Thomas Koenig wrote:
>> Ivan Godard <ivan@millcomputing.com> schrieb:
>>
>>> The lit history is full of efforts to put units into the type systems.
>>> They sure look plausible but don't work. Think of a NR sqrt routine.
>>
>> MathCad has got this right. It is not a compiled language,
>> but it certainly works. I use it a lot in my day job for simple
>> engineering calculations: You see the formulas, you immediately
>> see the output, you do input in units (like kg/h), you can convert
>> the output to units you want.
>>
>> And, of course, it complains if you try to add or subtract
>> dimensions that do not match.
>
> What happens if you multiply two variables with dimension "length"
> together? Does it understand that the result is an "area"?

It understands that the result is a length squared (and you can
put in an area measurement if you feel like it).

The only thing it cannot determine is the difference between
torque and work - when I calculate a torque, a "J" automtically
appears as a unit. I can change it to "N m" by hand, though.

> And that is
> a simple case. You can get far more complex combinations than that. It
> seems to me that this could be a nearly bottomless pit.

It works pretty well, as long as your formulas are consistent.

Some people like to write fomulas like pressure = velocity ^1.2342,
of course it will be flagged. However, the problem is with the
people writing the formula, not the program.

Re: Use Rust instead? (Was Re: Paper about ISO C)

<sl8mhp$ipt$4@newsreader4.netcologne.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21627&group=comp.arch#21627

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-465a-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Use Rust instead? (Was Re: Paper about ISO C)
Date: Tue, 26 Oct 2021 10:50:33 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <sl8mhp$ipt$4@newsreader4.netcologne.de>
References: <87fstdumxd.fsf@hotmail.com> <sjugcv$jio$1@dont-email.me>
<cb6bbb41-398f-4e2a-9a19-08bc4582b291n@googlegroups.com>
<sk437c$672$1@dont-email.me> <jwvee8qgxk0.fsf-monnier+comp.arch@gnu.org>
<2021Oct12.185057@mips.complang.tuwien.ac.at>
<jwvzgre88y4.fsf-monnier+comp.arch@gnu.org>
<5f97b29e-e958-49e2-bb1c-c0e9870f9c2bn@googlegroups.com>
<sku3dr$1hb$2@dont-email.me>
<5d25afd4-0e2c-4e98-a457-a04be5ae88dbn@googlegroups.com>
<2021Oct23.192433@mips.complang.tuwien.ac.at>
<sl3m7f$11am$1@gioia.aioe.org>
<2021Oct25.181949@mips.complang.tuwien.ac.at>
Injection-Date: Tue, 26 Oct 2021 10:50:33 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-465a-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:465a:0:7285:c2ff:fe6c:992d";
logging-data="19261"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Tue, 26 Oct 2021 10:50 UTC

Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
> Terje Mathisen <terje.mathisen@tmsw.no> writes:
>>Anton Ertl wrote:
>>> Quadibloc <jsavard@ecn.ab.ca> writes:
>>>> That isn't a solution. If the problem is to satisfy both sides,
>>>> killing the branch of the language that satisfies one of them
>>>> constitutes failure; one side is not satisfied.
>>>>
>>>> However, reality is more complex than that. The reality is
>>>> that C99 and gcc are viewed by the dissatisfied side as
>>>> just that "solution" as having happened already...
>>>
>>> Actually, it seems to me that C++ is the solution for the nasal demon
>>> worshippers. And once C compilers started to be written by C++
>>> programmers, they applied the C++ view of how to deal with undefined
>>> behaviour also to C.
>>
>>So why aren't more people switching to Rust?
>
> More generally, why aren't people switching to other programming
> languages? Because they have a legacy of C code.

Or because they like the language, or do not feel like being
constrained, or the language is not available on their
favorite platform, or...

In general, I am in favor of languages which lets me do things I
cannot do in other languages. I am less a fan of languages which
try to educate me what to use and not to use.

Pages:123456789101112131415161718192021222324252627282930313233
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor