Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"If it ain't broke, don't fix it." -- Bert Lantz


devel / comp.arch / Re: Dense machine code from C++ code (compiler optimizations)

SubjectAuthor
* Dense machine code from C++ code (compiler optimizations)Marcus
+* Re: Dense machine code from C++ code (compiler optimizations)Terje Mathisen
|`- Re: Dense machine code from C++ code (compiler optimizations)Marcus
+* Re: Dense machine code from C++ code (compiler optimizations)BGB
|+* Re: Dense machine code from C++ code (compiler optimizations)robf...@gmail.com
||`* Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
|| `* Re: Dense machine code from C++ code (compiler optimizations)BGB
||  +- Re: Dense machine code from C++ code (compiler optimizations)Ivan Godard
||  `* Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
||   +* Re: Dense machine code from C++ code (compiler optimizations)Ivan Godard
||   |`- Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
||   `* Re: Dense machine code from C++ code (compiler optimizations)BGB
||    `* Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
||     `* Re: Dense machine code from C++ code (compiler optimizations)BGB
||      +* Re: Dense machine code from C++ code (compiler optimizations)robf...@gmail.com
||      |+- Re: Dense machine code from C++ code (compiler optimizations)BGB
||      |`* Re: Thor (was: Dense machine code...)Marcus
||      | `* Re: Thor (was: Dense machine code...)robf...@gmail.com
||      |  +- Re: ThorEricP
||      |  `* Re: Thor (was: Dense machine code...)Marcus
||      |   `- Re: Thor (was: Dense machine code...)robf...@gmail.com
||      `* Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
||       `* Re: Dense machine code from C++ code (compiler optimizations)BGB
||        `* Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
||         `* Re: Dense machine code from C++ code (compiler optimizations)BGB
||          `* Re: Dense machine code from C++ code (compiler optimizations)BGB
||           `* Re: Testing with open source games (was Dense machine code ...)Marcus
||            +* Re: Testing with open source games (was Dense machine code ...)Terje Mathisen
||            |`* Re: Testing with open source games (was Dense machine code ...)Marcus
||            | +- Re: Testing with open source games (was Dense machine code ...)Terje Mathisen
||            | `* Re: Testing with open source games (was Dense machine code ...)James Van Buskirk
||            |  `- Re: Testing with open source games (was Dense machine code ...)Marcus
||            `- Re: Testing with open source games (was Dense machine code ...)BGB
|`* Re: Dense machine code from C++ code (compiler optimizations)Marcus
| +* Re: Dense machine code from C++ code (compiler optimizations)Ivan Godard
| |+- Re: Dense machine code from C++ code (compiler optimizations)Thomas Koenig
| |`* Re: Dense machine code from C++ code (compiler optimizations)BGB
| | `* Re: Dense machine code from C++ code (compiler optimizations)Ivan Godard
| |  +- Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
| |  `- Re: Dense machine code from C++ code (compiler optimizations)BGB
| +* Re: Dense machine code from C++ code (compiler optimizations)BGB
| |`- Re: Dense machine code from C++ code (compiler optimizations)Paul A. Clayton
| `* Re: Dense machine code from C++ code (compiler optimizations)Thomas Koenig
|  `* Re: Dense machine code from C++ code (compiler optimizations)Marcus
|   +* Re: Dense machine code from C++ code (compiler optimizations)Thomas Koenig
|   |`* Re: Dense machine code from C++ code (compiler optimizations)Marcus
|   | `- Re: Dense machine code from C++ code (compiler optimizations)Thomas Koenig
|   `* Re: Dense machine code from C++ code (compiler optimizations)BGB
|    +* Re: Dense machine code from C++ code (compiler optimizations)Marcus
|    |`- Re: Dense machine code from C++ code (compiler optimizations)George Neuner
|    `* Re: Dense machine code from C++ code (compiler optimizations)David Brown
|     `* Re: Dense machine code from C++ code (compiler optimizations)Marcus
|      `* Re: Dense machine code from C++ code (compiler optimizations)Terje Mathisen
|       +* Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
|       |`- Re: Dense machine code from C++ code (compiler optimizations)Terje Mathisen
|       +- Re: Dense machine code from C++ code (compiler optimizations)BGB
|       `- Re: Dense machine code from C++ code (compiler optimizations)Marcus
`* Re: Dense machine code from C++ code (compiler optimizations)Ir. Hj. Othman bin Hj. Ahmad
 +- Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
 `* Re: Dense machine code from C++ code (compiler optimizations)Thomas Koenig
  +* Re: Dense machine code from C++ code (compiler optimizations)chris
  |`* Re: Dense machine code from C++ code (compiler optimizations)David Brown
  | `* Re: Dense machine code from C++ code (compiler optimizations)chris
  |  +* Re: Dense machine code from C++ code (compiler optimizations)David Brown
  |  |`- Re: Dense machine code from C++ code (compiler optimizations)chris
  |  `* Re: Dense machine code from C++ code (compiler optimizations)Terje Mathisen
  |   `* Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
  |    +- Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
  |    `* Re: Dense machine code from C++ code (compiler optimizations)Terje Mathisen
  |     `- Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
  +* Re: Dense machine code from C++ code (compiler optimizations)David Brown
  |`* Re: Dense machine code from C++ code (compiler optimizations)BGB
  | `* Re: Dense machine code from C++ code (compiler optimizations)David Brown
  |  `* Re: Dense machine code from C++ code (compiler optimizations)BGB
  |   +* Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
  |   |`* Re: Dense machine code from C++ code (compiler optimizations)BGB
  |   | `- Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
  |   `* Re: Dense machine code from C++ code (compiler optimizations)David Brown
  |    `- Re: Dense machine code from C++ code (compiler optimizations)BGB
  `* Re: Dense machine code from C++ code (compiler optimizations)Stephen Fuld
   +* Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
   |`- Re: Dense machine code from C++ code (compiler optimizations)Stephen Fuld
   +* Re: Dense machine code from C++ code (compiler optimizations)James Van Buskirk
   |`* Re: Dense machine code from C++ code (compiler optimizations)Stephen Fuld
   | +* Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
   | |+- Re: Dense machine code from C++ code (compiler optimizations)Marcus
   | |`* Re: Dense machine code from C++ code (compiler optimizations)Terje Mathisen
   | | `* Re: Dense machine code from C++ code (compiler optimizations)Stephen Fuld
   | |  `* Re: Dense machine code from C++ code (compiler optimizations)EricP
   | |   `* Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
   | |    `* Re: Dense machine code from C++ code (compiler optimizations)EricP
   | |     `* Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
   | |      `- Re: Dense machine code from C++ code (compiler optimizations)EricP
   | `* Re: Dense machine code from C++ code (compiler optimizations)Tim Rentsch
   |  +* Re: Dense machine code from C++ code (compiler optimizations)Stephen Fuld
   |  |+* Re: Dense machine code from C++ code (compiler optimizations)Guillaume
   |  ||+* Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
   |  |||+- Re: Dense machine code from C++ code (compiler optimizations)Thomas Koenig
   |  |||`* Re: Dense machine code from C++ code (compiler optimizations)Guillaume
   |  ||| +* Re: Dense machine code from C++ code (compiler optimizations)MitchAlsup
   |  ||| |`* Re: Dense machine code from C++ code (compiler optimizations)Andreas Eder
   |  ||| `- Re: Dense machine code from C++ code (compiler optimizations)Tim Rentsch
   |  ||`- Re: Dense machine code from C++ code (compiler optimizations)Tim Rentsch
   |  |`* Re: Dense machine code from C++ code (compiler optimizations)Tim Rentsch
   |  `* Re: Dense machine code from C++ code (compiler optimizations)Ivan Godard
   `- Re: Dense machine code from C++ code (compiler optimizations)Andreas Eder

Pages:12345678
Re: Dense machine code from C++ code (compiler optimizations)

<3773e6bc-7641-4512-a8d5-d3cab2385558n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:622a:181c:: with SMTP id t28mr645982qtc.633.1640304657867;
Thu, 23 Dec 2021 16:10:57 -0800 (PST)
X-Received: by 2002:a9d:ba8:: with SMTP id 37mr2429103oth.227.1640304657658;
Thu, 23 Dec 2021 16:10:57 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.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: Thu, 23 Dec 2021 16:10:57 -0800 (PST)
In-Reply-To: <sq2vkc$qp3$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:e059:ae75:daba:c413;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:e059:ae75:daba:c413
References: <sndun6$q07$1@dont-email.me> <dc10dfff-b48e-40ec-8c24-0a6c2e1790d2n@googlegroups.com>
<sphe6s$5a3$1@newsreader4.netcologne.de> <spqc1d$oio$1@dont-email.me>
<spqhj2$gdf$1@dont-email.me> <spqkjk$7ug$1@dont-email.me> <86mtks1j79.fsf@linuxsc.com>
<sq2acu$hg3$1@dont-email.me> <sq2hfi$lah$1@gioia.aioe.org>
<cc7b7735-d386-4b43-ac97-035c647d7f05n@googlegroups.com> <sq2vkc$qp3$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3773e6bc-7641-4512-a8d5-d3cab2385558n@googlegroups.com>
Subject: Re: Dense machine code from C++ code (compiler optimizations)
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Fri, 24 Dec 2021 00:10:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 28
 by: MitchAlsup - Fri, 24 Dec 2021 00:10 UTC

On Thursday, December 23, 2021 at 5:10:07 PM UTC-6, Guillaume wrote:
> Le 23/12/2021 à 20:37, MitchAlsup a écrit :
> > The only benefit to developers would be some kind of syntactic sugar to make
> > bit fields easier to specify::
> > <
> > a<3:17> = b<9:23>;
> Oh, I perfectly get that, and I agree this notation would be quite nice.
> > Macros seem to fail in that they cannot do syntactic sugar things.
<
> Not this kind, indeed. But the whole question regarding the standard is,
> is it really worth it to make additions to it just for some syntactic
> sugar? This is not the spirit of C.
<
Adding it syntactically into the language would allow the offset and width
to be anything in the range of an integer--imagine a bit field 11,357 bits long
at offset 1,496 into a 29,000-bit container--and the compiler knows what code
to produce. That is: real bit fields.
<
Perhaps this is a job for C++
>
> But in that same vein, I would have a number of other notations I would
> like to have in C. A lot more than just this. Thing is, who knows where
> that would lead the language.

Re: Dense machine code from C++ code (compiler optimizations)

<sq372j$80q$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: Dense machine code from C++ code (compiler optimizations)
Date: Thu, 23 Dec 2021 17:17:05 -0800
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <sq372j$80q$1@dont-email.me>
References: <sndun6$q07$1@dont-email.me>
<dc10dfff-b48e-40ec-8c24-0a6c2e1790d2n@googlegroups.com>
<sphe6s$5a3$1@newsreader4.netcologne.de> <spqc1d$oio$1@dont-email.me>
<spqhj2$gdf$1@dont-email.me> <spqkjk$7ug$1@dont-email.me>
<86mtks1j79.fsf@linuxsc.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 24 Dec 2021 01:17:07 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="9a2cabefa040a7e93dfda2b6175e4f28";
logging-data="8218"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+bbMKh9PbW6xLjy6ZXYdpW"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.4.0
Cancel-Lock: sha1:SwcGZWlmBgNTk/djXBfY1Dd0z/M=
In-Reply-To: <86mtks1j79.fsf@linuxsc.com>
Content-Language: en-US
 by: Ivan Godard - Fri, 24 Dec 2021 01:17 UTC

On 12/22/2021 12:24 PM, Tim Rentsch wrote:
<snip>

>
> Not necessarily an answer but an observation: in C no new language
> feature is needed, because C has the C preprocessor. It isn't hard
> to write a macro that does the necessary shifting and masking (and
> these days compilers are mostly smart enough to recognize the common
> patterns and translate them efficiently and in machine-specific
> ways).

The C preprocessor is an invention of the Devil.

It lacks the power of a real macro language like m4, yet has all the
drawbacks of scopeless text substitution.

Re: Dense machine code from C++ code (compiler optimizations)

<b7678f7c-dcc3-4213-90ed-169776201d8dn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a37:bd05:: with SMTP id n5mr3353533qkf.293.1640310279899;
Thu, 23 Dec 2021 17:44:39 -0800 (PST)
X-Received: by 2002:a05:6808:2396:: with SMTP id bp22mr3657570oib.78.1640310279585;
Thu, 23 Dec 2021 17:44:39 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.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: Thu, 23 Dec 2021 17:44:39 -0800 (PST)
In-Reply-To: <sq372j$80q$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=136.50.253.102; posting-account=AoizIQoAAADa7kQDpB0DAj2jwddxXUgl
NNTP-Posting-Host: 136.50.253.102
References: <sndun6$q07$1@dont-email.me> <dc10dfff-b48e-40ec-8c24-0a6c2e1790d2n@googlegroups.com>
<sphe6s$5a3$1@newsreader4.netcologne.de> <spqc1d$oio$1@dont-email.me>
<spqhj2$gdf$1@dont-email.me> <spqkjk$7ug$1@dont-email.me> <86mtks1j79.fsf@linuxsc.com>
<sq372j$80q$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b7678f7c-dcc3-4213-90ed-169776201d8dn@googlegroups.com>
Subject: Re: Dense machine code from C++ code (compiler optimizations)
From: jim.brak...@ieee.org (JimBrakefield)
Injection-Date: Fri, 24 Dec 2021 01:44:39 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 24
 by: JimBrakefield - Fri, 24 Dec 2021 01:44 UTC

On Thursday, December 23, 2021 at 7:17:10 PM UTC-6, Ivan Godard wrote:
> On 12/22/2021 12:24 PM, Tim Rentsch wrote:
> <snip>
>
> >
> > Not necessarily an answer but an observation: in C no new language
> > feature is needed, because C has the C preprocessor. It isn't hard
> > to write a macro that does the necessary shifting and masking (and
> > these days compilers are mostly smart enough to recognize the common
> > patterns and translate them efficiently and in machine-specific
> > ways).
>
> The C preprocessor is an invention of the Devil.
>
> It lacks the power of a real macro language like m4, yet has all the
> drawbacks of scopeless text substitution.

Looks like C++ is moving away from macros/preprocessor
And trying to be a respectable language
Stroustrup video from CppCon2021: https://www.youtube.com/watch?v=15QF2q66NhU

Ran across the Zig language recently: https://ziglang.org/
It would make a great HLS language as it wants to be a C replacement
and offers signed and unsigned integers of any bit width up to 65K.
Currently at release 0.9, eg a work in progress

Re: Dense machine code from C++ code (compiler optimizations)

<sq3jfb$r9a$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bak...@iitbombay.org (Bakul Shah)
Newsgroups: comp.arch
Subject: Re: Dense machine code from C++ code (compiler optimizations)
Date: Thu, 23 Dec 2021 20:48:41 -0800
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <sq3jfb$r9a$1@dont-email.me>
References: <sndun6$q07$1@dont-email.me>
<dc10dfff-b48e-40ec-8c24-0a6c2e1790d2n@googlegroups.com>
<sphe6s$5a3$1@newsreader4.netcologne.de> <spqc1d$oio$1@dont-email.me>
<spqhj2$gdf$1@dont-email.me> <spqkjk$7ug$1@dont-email.me>
<86mtks1j79.fsf@linuxsc.com> <sq372j$80q$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 24 Dec 2021 04:48:43 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b154da616bc4486f9a745764ce2d5d8a";
logging-data="27946"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19mU0JSa1/dCnnPh8Y1yaFn"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:68.0)
Gecko/20100101 Firefox/68.0 SeaMonkey/2.53.10.1
Cancel-Lock: sha1:uGwbOThzhObWP+DNYKKeYZ+WNv4=
In-Reply-To: <sq372j$80q$1@dont-email.me>
 by: Bakul Shah - Fri, 24 Dec 2021 04:48 UTC

On 12/23/21 5:17 PM, Ivan Godard wrote:
> On 12/22/2021 12:24 PM, Tim Rentsch wrote:
> <snip>
>
>>
>> Not necessarily an answer but an observation:  in C no new language
>> feature is needed, because C has the C preprocessor.  It isn't hard
>> to write a macro that does the necessary shifting and masking (and
>> these days compilers are mostly smart enough to recognize the common
>> patterns and translate them efficiently and in machine-specific
>> ways).
>
> The C preprocessor is an invention of the Devil.
>
> It lacks the power of a real macro language like m4, yet has all the
> drawbacks of scopeless text substitution.

Didn't your Mary language have text-based recursive macros?
Though I have not seen a description of it.

Re: Dense machine code from C++ code (compiler optimizations)

<sq3pei$k61$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: Dense machine code from C++ code (compiler optimizations)
Date: Thu, 23 Dec 2021 22:30:41 -0800
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <sq3pei$k61$1@dont-email.me>
References: <sndun6$q07$1@dont-email.me>
<dc10dfff-b48e-40ec-8c24-0a6c2e1790d2n@googlegroups.com>
<sphe6s$5a3$1@newsreader4.netcologne.de> <spqc1d$oio$1@dont-email.me>
<spqhj2$gdf$1@dont-email.me> <spqkjk$7ug$1@dont-email.me>
<86mtks1j79.fsf@linuxsc.com> <sq372j$80q$1@dont-email.me>
<sq3jfb$r9a$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 24 Dec 2021 06:30:42 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="9a2cabefa040a7e93dfda2b6175e4f28";
logging-data="20673"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/JFa8I9uL4Xau8wW2CyYLR"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.4.0
Cancel-Lock: sha1:tGqstW5V2P5DzZYZcbbaWZOdczM=
In-Reply-To: <sq3jfb$r9a$1@dont-email.me>
Content-Language: en-US
 by: Ivan Godard - Fri, 24 Dec 2021 06:30 UTC

On 12/23/2021 8:48 PM, Bakul Shah wrote:
> On 12/23/21 5:17 PM, Ivan Godard wrote:
>> On 12/22/2021 12:24 PM, Tim Rentsch wrote:
>> <snip>
>>
>>>
>>> Not necessarily an answer but an observation:  in C no new language
>>> feature is needed, because C has the C preprocessor.  It isn't hard
>>> to write a macro that does the necessary shifting and masking (and
>>> these days compilers are mostly smart enough to recognize the common
>>> patterns and translate them efficiently and in machine-specific
>>> ways).
>>
>> The C preprocessor is an invention of the Devil.
>>
>> It lacks the power of a real macro language like m4, yet has all the
>> drawbacks of scopeless text substitution.
>
> Didn't your Mary language have text-based recursive macros?
> Though I have not seen a description of it.

Not text; bound names, like the (25 years later) C++ templates.

Re: Dense machine code from C++ code (compiler optimizations)

<87bl16gni2.fsf@eder.anydns.info>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: a_eder_...@web.de (Andreas Eder)
Newsgroups: comp.arch
Subject: Re: Dense machine code from C++ code (compiler optimizations)
Date: Fri, 24 Dec 2021 14:07:17 +0100
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <87bl16gni2.fsf@eder.anydns.info>
References: <sndun6$q07$1@dont-email.me>
<dc10dfff-b48e-40ec-8c24-0a6c2e1790d2n@googlegroups.com>
<sphe6s$5a3$1@newsreader4.netcologne.de> <spqc1d$oio$1@dont-email.me>
<spqhj2$gdf$1@dont-email.me> <spqkjk$7ug$1@dont-email.me>
<86mtks1j79.fsf@linuxsc.com> <sq2acu$hg3$1@dont-email.me>
<sq2hfi$lah$1@gioia.aioe.org>
<cc7b7735-d386-4b43-ac97-035c647d7f05n@googlegroups.com>
<sq2vkc$qp3$1@gioia.aioe.org>
<3773e6bc-7641-4512-a8d5-d3cab2385558n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="3d435c861806fcfe53d5bc39380a6672";
logging-data="21563"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tB8hs7Ta1oJ1gVj0mxi6X"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Cancel-Lock: sha1:Z5tcyB7t98hEW6Uy8ytKfR3MPvE=
sha1:Gp306SrwQIEqqCY7vlxtovqXacU=
 by: Andreas Eder - Fri, 24 Dec 2021 13:07 UTC

On Do 23 Dez 2021 at 16:10, MitchAlsup <MitchAlsup@aol.com> wrote:

> Adding it syntactically into the language would allow the offset and width
> to be anything in the range of an integer--imagine a bit field 11,357 bits long
> at offset 1,496 into a 29,000-bit container--and the compiler knows what code
> to produce. That is: real bit fields.
> <
> Perhaps this is a job for C++

Just gave a look into Common Lisp!

'Andreas

Re: Dense machine code from C++ code (compiler optimizations)

<sq4l7a$21u$1@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd4-c1ea-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Dense machine code from C++ code (compiler optimizations)
Date: Fri, 24 Dec 2021 14:24:42 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <sq4l7a$21u$1@newsreader4.netcologne.de>
References: <sndun6$q07$1@dont-email.me>
<dc10dfff-b48e-40ec-8c24-0a6c2e1790d2n@googlegroups.com>
<sphe6s$5a3$1@newsreader4.netcologne.de> <spqc1d$oio$1@dont-email.me>
<spqhj2$gdf$1@dont-email.me> <spqkjk$7ug$1@dont-email.me>
<86mtks1j79.fsf@linuxsc.com> <sq372j$80q$1@dont-email.me>
Injection-Date: Fri, 24 Dec 2021 14:24:42 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd4-c1ea-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd4:c1ea:0:7285:c2ff:fe6c:992d";
logging-data="2110"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Fri, 24 Dec 2021 14:24 UTC

Ivan Godard <ivan@millcomputing.com> schrieb:
> On 12/22/2021 12:24 PM, Tim Rentsch wrote:
><snip>
>
>>
>> Not necessarily an answer but an observation: in C no new language
>> feature is needed, because C has the C preprocessor. It isn't hard
>> to write a macro that does the necessary shifting and masking (and
>> these days compilers are mostly smart enough to recognize the common
>> patterns and translate them efficiently and in machine-specific
>> ways).
>
> The C preprocessor is an invention of the Devil.
>
> It lacks the power of a real macro language like m4, yet has all the
> drawbacks of scopeless text substitution.

You may have worked more with m4 than I have, but I have found it
a rather severe example of hit and miss programming. Change some
quoting, run m4, check against wanted results. Repeat until
success or total frustration is achieved.

Re: Dense machine code from C++ code (compiler optimizations)

<sq4p88$77q$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: Dense machine code from C++ code (compiler optimizations)
Date: Fri, 24 Dec 2021 07:33:28 -0800
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <sq4p88$77q$1@dont-email.me>
References: <sndun6$q07$1@dont-email.me>
<dc10dfff-b48e-40ec-8c24-0a6c2e1790d2n@googlegroups.com>
<sphe6s$5a3$1@newsreader4.netcologne.de> <spqc1d$oio$1@dont-email.me>
<spqhj2$gdf$1@dont-email.me> <spqkjk$7ug$1@dont-email.me>
<86mtks1j79.fsf@linuxsc.com> <sq372j$80q$1@dont-email.me>
<sq4l7a$21u$1@newsreader4.netcologne.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 24 Dec 2021 15:33:28 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="9a2cabefa040a7e93dfda2b6175e4f28";
logging-data="7418"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18JzNgj5n61+WQQoYYkGKu1"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.4.1
Cancel-Lock: sha1:jHY7jdGLXCkyhT+JQmCr/w+DJgY=
In-Reply-To: <sq4l7a$21u$1@newsreader4.netcologne.de>
Content-Language: en-US
 by: Ivan Godard - Fri, 24 Dec 2021 15:33 UTC

On 12/24/2021 6:24 AM, Thomas Koenig wrote:
> Ivan Godard <ivan@millcomputing.com> schrieb:
>> On 12/22/2021 12:24 PM, Tim Rentsch wrote:
>> <snip>
>>
>>>
>>> Not necessarily an answer but an observation: in C no new language
>>> feature is needed, because C has the C preprocessor. It isn't hard
>>> to write a macro that does the necessary shifting and masking (and
>>> these days compilers are mostly smart enough to recognize the common
>>> patterns and translate them efficiently and in machine-specific
>>> ways).
>>
>> The C preprocessor is an invention of the Devil.
>>
>> It lacks the power of a real macro language like m4, yet has all the
>> drawbacks of scopeless text substitution.
>
> You may have worked more with m4 than I have, but I have found it
> a rather severe example of hit and miss programming. Change some
> quoting, run m4, check against wanted results. Repeat until
> success or total frustration is achieved.

I quite agree - macro languages tend to be write-only. But they are true
second-order, and so are very powerful. Conventional languages (absent
things like C++ templates and all of SmallTalk and the like) can only do
second-order by generating new program text and then running that
through the compiler again.

But *any* second-order programming (the program, not the language) is a
non-trivial exercise. Most writers solve the intellectual tractability
problem by writing first order programs in their second order language -
c.f. compiling what might as well have been a C program with a C++
compiler.

Have you ever defined a template that took a template argument?

Re: Dense machine code from C++ code (compiler optimizations)

<sq515l$klf$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!aioe.org!UgLt14+w9tVHe1BtIa3HDQ.user.46.165.242.75.POSTED!not-for-mail
From: mess...@bottle.org (Guillaume)
Newsgroups: comp.arch
Subject: Re: Dense machine code from C++ code (compiler optimizations)
Date: Fri, 24 Dec 2021 18:48:34 +0100
Organization: Aioe.org NNTP Server
Message-ID: <sq515l$klf$1@gioia.aioe.org>
References: <sndun6$q07$1@dont-email.me>
<dc10dfff-b48e-40ec-8c24-0a6c2e1790d2n@googlegroups.com>
<sphe6s$5a3$1@newsreader4.netcologne.de> <spqc1d$oio$1@dont-email.me>
<spqhj2$gdf$1@dont-email.me> <spqkjk$7ug$1@dont-email.me>
<86mtks1j79.fsf@linuxsc.com> <sq372j$80q$1@dont-email.me>
<sq4l7a$21u$1@newsreader4.netcologne.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="21167"; posting-host="UgLt14+w9tVHe1BtIa3HDQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.4.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: fr
 by: Guillaume - Fri, 24 Dec 2021 17:48 UTC

Le 24/12/2021 à 15:24, Thomas Koenig a écrit :
> Ivan Godard <ivan@millcomputing.com> schrieb:
>> On 12/22/2021 12:24 PM, Tim Rentsch wrote:
>> <snip>
>>
>>>
>>> Not necessarily an answer but an observation: in C no new language
>>> feature is needed, because C has the C preprocessor. It isn't hard
>>> to write a macro that does the necessary shifting and masking (and
>>> these days compilers are mostly smart enough to recognize the common
>>> patterns and translate them efficiently and in machine-specific
>>> ways).
>>
>> The C preprocessor is an invention of the Devil.
>>
>> It lacks the power of a real macro language like m4, yet has all the
>> drawbacks of scopeless text substitution.
>
> You may have worked more with m4 than I have, but I have found it
> a rather severe example of hit and miss programming. Change some
> quoting, run m4, check against wanted results. Repeat until
> success or total frustration is achieved.

Yep. Same experience here. I also once tried replacing the C
preprocessor with M4. After a while, I realized that it was even worse
in terms of readability and ease of use, and not even powerful enough to
justify that.

Re: Dense machine code from C++ code (compiler optimizations)

<sq546h$as3$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: cr88...@gmail.com (BGB)
Newsgroups: comp.arch
Subject: Re: Dense machine code from C++ code (compiler optimizations)
Date: Fri, 24 Dec 2021 12:40:16 -0600
Organization: A noiseless patient Spider
Lines: 105
Message-ID: <sq546h$as3$1@dont-email.me>
References: <sndun6$q07$1@dont-email.me>
<dc10dfff-b48e-40ec-8c24-0a6c2e1790d2n@googlegroups.com>
<sphe6s$5a3$1@newsreader4.netcologne.de> <spqc1d$oio$1@dont-email.me>
<spqhj2$gdf$1@dont-email.me> <spqkjk$7ug$1@dont-email.me>
<86mtks1j79.fsf@linuxsc.com> <sq372j$80q$1@dont-email.me>
<sq4l7a$21u$1@newsreader4.netcologne.de> <sq4p88$77q$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 24 Dec 2021 18:40:17 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="29dd3cd53019c5a242f76c821a715dea";
logging-data="11139"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PWGzZKAIvTlLzw1bXA/lB"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.4.1
Cancel-Lock: sha1:9+HhDf5gtliOfkBXsvM6TSEb7As=
In-Reply-To: <sq4p88$77q$1@dont-email.me>
Content-Language: en-US
 by: BGB - Fri, 24 Dec 2021 18:40 UTC

On 12/24/2021 9:33 AM, Ivan Godard wrote:
> On 12/24/2021 6:24 AM, Thomas Koenig wrote:
>> Ivan Godard <ivan@millcomputing.com> schrieb:
>>> On 12/22/2021 12:24 PM, Tim Rentsch wrote:
>>> <snip>
>>>
>>>>
>>>> Not necessarily an answer but an observation:  in C no new language
>>>> feature is needed, because C has the C preprocessor.  It isn't hard
>>>> to write a macro that does the necessary shifting and masking (and
>>>> these days compilers are mostly smart enough to recognize the common
>>>> patterns and translate them efficiently and in machine-specific
>>>> ways).
>>>
>>> The C preprocessor is an invention of the Devil.
>>>
>>> It lacks the power of a real macro language like m4, yet has all the
>>> drawbacks of scopeless text substitution.
>>
>> You may have worked more with m4 than I have, but I have found it
>> a rather severe example of hit and miss programming.  Change some
>> quoting, run m4, check against wanted results.  Repeat until
>> success or total frustration is achieved.
>
> I quite agree - macro languages tend to be write-only. But they are true
> second-order, and so are very powerful. Conventional languages (absent
> things like C++ templates and all of SmallTalk and the like) can only do
> second-order by generating new program text and then running that
> through the compiler again.
>
> But *any* second-order programming (the program, not the language) is a
> non-trivial exercise. Most writers solve the intellectual tractability
> problem by writing first order programs in their second order language -
> c.f. compiling what might as well have been a C program with a C++
> compiler.
>
> Have you ever defined a template that took a template argument?

FWIW, I did experimentally add the ability to do something sorta like
PHP with the preprocessor in BGBCC; namely that code-generation
functions can be written in a JavaScript style language, and then
invoked as part of the macro expansion process.

Haven't really used it for much thus far as the actual need to do
anything like this is relatively infrequent.

Well, and also it is sorta now possible to compile JS style code in
BGBCC and link it directly with C code, though it is slightly less
dynamic than "true" JS:
Can't run arbitrary code in the toplevel;
No "eval" or similar (this would require an interpreter);
Doesn't automatically coerce strings into other types / ...;
Compiles to conventional native code (no real VM layer);
...

Though, more specifically, it is actually yet another language in the
wider family of "ECMAScript derived languages which constrain semantics
and add optional support for static types". Each language going its own
direction in terms of semantics and features, or which types exist, and
whether said types use camelCase or InitCaps, ...

In this case, it shares the same parser and compiler logic as when
compiling C code, just enabling/disabling some things in areas where the
languages differ.

Dynamic types and lambdas and similar are mostly handled by the runtime
library (dynamically typed code mostly compiles into a mass of function
calls).

There is also no GC in this case, but rather a simpler scheme:
New objects are initially "automatic scope"
If they don't leave the this scope, they remain here;
They are 'deleted' as soon as the function returns.
Assigning to a global location may move them into global scope:
Global Variable;
Array within a global scope;
Object field within a global scope.

Objects which move into the global scope may be manually deleted, but
otherwise do not go away on their own (so, this case is basically a
memory leak).

It is possible this could be extended to a zone system. Zones could be
organized in a tree, where objects either walk up the zone tree, or move
to global if no common zone exists. It would (by extension) be possible
for a program to delete all objects within a given zone.

Note that moving an object to a longer-lived zone will also recursively
apply to any other objects this object points to (objects can only point
to objects within a longer-lived zone).

While reference-counting is also theoretically possible, it has drawbacks:
Hard to get the ref-counting to be "always correct".
A minor mismatch somewhere can lead to the whole system breaking.
Fairly high runtime overhead compared with most other options.
Prone to leak if circular links form.

Could also add a (semi)conservative mark/sweep:
Mostly plays well with C (excluding a few "mostly theoretical" edge cases);
However, adds code bulk and does not play well with real-time systems.

....

Re: Macros, threat or menace, was Dense machine code from C++ code (compiler optimizations)

<sq5865$1cn9$1@gal.iecc.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!not-for-mail
From: joh...@taugh.com (John Levine)
Newsgroups: comp.arch
Subject: Re: Macros, threat or menace, was Dense machine code from C++ code (compiler optimizations)
Date: Fri, 24 Dec 2021 19:48:21 -0000 (UTC)
Organization: Taughannock Networks
Message-ID: <sq5865$1cn9$1@gal.iecc.com>
References: <sndun6$q07$1@dont-email.me> <sq372j$80q$1@dont-email.me> <sq4l7a$21u$1@newsreader4.netcologne.de> <sq4p88$77q$1@dont-email.me>
Injection-Date: Fri, 24 Dec 2021 19:48:21 -0000 (UTC)
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970";
logging-data="45801"; mail-complaints-to="abuse@iecc.com"
In-Reply-To: <sndun6$q07$1@dont-email.me> <sq372j$80q$1@dont-email.me> <sq4l7a$21u$1@newsreader4.netcologne.de> <sq4p88$77q$1@dont-email.me>
Cleverness: some
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: johnl@iecc.com (John Levine)
 by: John Levine - Fri, 24 Dec 2021 19:48 UTC

According to Ivan Godard <ivan@millcomputing.com>:
>I quite agree - macro languages tend to be write-only. But they are true
>second-order, and so are very powerful. Conventional languages (absent
>things like C++ templates and all of SmallTalk and the like) can only do
>second-order by generating new program text and then running that
>through the compiler again.
>
>But *any* second-order programming (the program, not the language) is a
>non-trivial exercise. Most writers solve the intellectual tractability
>problem by writing first order programs in their second order language -
>c.f. compiling what might as well have been a C program with a C++
>compiler.

That's one of the things that PL/I did well over 50 years ago. The PL/I
preprocessor is a PL/I subset adeqate to do the kind of text
processing that preprocessors need. Considering what a rush job it was,
PL/I was a surprisingly good language.

Back in my youth I recall a student PL/I setup that limited the run time
of a program but not the compile time, so some bright bulb wrote a
program that did everything in the preprocessor, generating just a
print statement of the result.

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

Re: Macros, threat or menace, was Dense machine code from C++ code (compiler optimizations)

<b23bb66b-d466-4b2d-be44-ffb2c6dfceeen@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:5e4d:: with SMTP id i13mr7047922qtx.232.1640381270436;
Fri, 24 Dec 2021 13:27:50 -0800 (PST)
X-Received: by 2002:a9d:4d8b:: with SMTP id u11mr5559042otk.144.1640381270138;
Fri, 24 Dec 2021 13:27:50 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.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: Fri, 24 Dec 2021 13:27:49 -0800 (PST)
In-Reply-To: <sq5865$1cn9$1@gal.iecc.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:d876:5ad9:f900:90dc;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:d876:5ad9:f900:90dc
References: <sndun6$q07$1@dont-email.me> <sq372j$80q$1@dont-email.me>
<sq4l7a$21u$1@newsreader4.netcologne.de> <sq4p88$77q$1@dont-email.me> <sq5865$1cn9$1@gal.iecc.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b23bb66b-d466-4b2d-be44-ffb2c6dfceeen@googlegroups.com>
Subject: Re: Macros, threat or menace, was Dense machine code from C++ code
(compiler optimizations)
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Fri, 24 Dec 2021 21:27:50 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 38
 by: MitchAlsup - Fri, 24 Dec 2021 21:27 UTC

On Friday, December 24, 2021 at 1:48:23 PM UTC-6, John Levine wrote:
> According to Ivan Godard <iv...@millcomputing.com>:
> >I quite agree - macro languages tend to be write-only. But they are true
> >second-order, and so are very powerful. Conventional languages (absent
> >things like C++ templates and all of SmallTalk and the like) can only do
> >second-order by generating new program text and then running that
> >through the compiler again.
> >
> >But *any* second-order programming (the program, not the language) is a
> >non-trivial exercise. Most writers solve the intellectual tractability
> >problem by writing first order programs in their second order language -
> >c.f. compiling what might as well have been a C program with a C++
> >compiler.
> That's one of the things that PL/I did well over 50 years ago. The PL/I
> preprocessor is a PL/I subset adeqate to do the kind of text
> processing that preprocessors need. Considering what a rush job it was,
> PL/I was a surprisingly good language.
>
> Back in my youth I recall a student PL/I setup that limited the run time
> of a program but not the compile time, so some bright bulb wrote a
> program that did everything in the preprocessor, generating just a
> print statement of the result.
<
WATFIV was a compile-and-run environment which CMU limited to 1 second of
execution time. We found that if you were "in" a write-statement it only checked
CPU time before and after the write; so, we could run almost arbitrarily long
programs as long as they could be made to execute entirely within a write-
statement !
<
But I have (still) never found a compiler so friendly with debug and warning
messages as PL/C. I once inserted a card deck into the card reader backwards
and the PL/C compiler found all the end-do loops ,... and even crafted meaningful
error and warning messages that made sense to the programmer (not the compiler
writer). If they could do that in 1973 why can't we do that today ?
>
> --
> Regards,
> John Levine, jo...@taugh.com, Primary Perpetrator of "The Internet for Dummies",
> Please consider the environment before reading this e-mail. https://jl.ly

Re: Macros, threat or menace, was Dense machine code from C++ code (compiler optimizations)

<541dba94-b488-44e5-a939-1557f3ea9709n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:4652:: with SMTP id f18mr7095641qto.381.1640381341555;
Fri, 24 Dec 2021 13:29:01 -0800 (PST)
X-Received: by 2002:a05:6830:1445:: with SMTP id w5mr5681467otp.112.1640381341271;
Fri, 24 Dec 2021 13:29:01 -0800 (PST)
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: Fri, 24 Dec 2021 13:29:01 -0800 (PST)
In-Reply-To: <sq5865$1cn9$1@gal.iecc.com>
Injection-Info: google-groups.googlegroups.com; posting-host=136.50.253.102; posting-account=AoizIQoAAADa7kQDpB0DAj2jwddxXUgl
NNTP-Posting-Host: 136.50.253.102
References: <sndun6$q07$1@dont-email.me> <sq372j$80q$1@dont-email.me>
<sq4l7a$21u$1@newsreader4.netcologne.de> <sq4p88$77q$1@dont-email.me> <sq5865$1cn9$1@gal.iecc.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <541dba94-b488-44e5-a939-1557f3ea9709n@googlegroups.com>
Subject: Re: Macros, threat or menace, was Dense machine code from C++ code
(compiler optimizations)
From: jim.brak...@ieee.org (JimBrakefield)
Injection-Date: Fri, 24 Dec 2021 21:29:01 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 32
 by: JimBrakefield - Fri, 24 Dec 2021 21:29 UTC

On Friday, December 24, 2021 at 1:48:23 PM UTC-6, John Levine wrote:
> According to Ivan Godard <iv...@millcomputing.com>:
> >I quite agree - macro languages tend to be write-only. But they are true
> >second-order, and so are very powerful. Conventional languages (absent
> >things like C++ templates and all of SmallTalk and the like) can only do
> >second-order by generating new program text and then running that
> >through the compiler again.
> >
> >But *any* second-order programming (the program, not the language) is a
> >non-trivial exercise. Most writers solve the intellectual tractability
> >problem by writing first order programs in their second order language -
> >c.f. compiling what might as well have been a C program with a C++
> >compiler.
> That's one of the things that PL/I did well over 50 years ago. The PL/I
> preprocessor is a PL/I subset adeqate to do the kind of text
> processing that preprocessors need. Considering what a rush job it was,
> PL/I was a surprisingly good language.
>
> Back in my youth I recall a student PL/I setup that limited the run time
> of a program but not the compile time, so some bright bulb wrote a
> program that did everything in the preprocessor, generating just a
> print statement of the result.
>
> --
> Regards,
> John Levine, jo...@taugh.com, Primary Perpetrator of "The Internet for Dummies",
> Please consider the environment before reading this e-mail. https://jl.ly

At my current level of understanding:
An interesting feature of Zig is that instead of a macro or preprocessor the compiler
will execute at compile time anything the can be computed at compile time
(including type expressions). Thus the language itself is it's own preprocessor.
And like the RTL languages, simplification and reduction is carried as far as possible.

Re: Macros, threat or menace, was Dense machine code from C++ code (compiler optimizations)

<e6872d0f-ce0b-4ff3-a4e1-3c7d2644d69bn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:a05:620a:430e:: with SMTP id u14mr5958361qko.286.1640383778412;
Fri, 24 Dec 2021 14:09:38 -0800 (PST)
X-Received: by 2002:a9d:ba8:: with SMTP id 37mr5170278oth.227.1640383778162;
Fri, 24 Dec 2021 14:09:38 -0800 (PST)
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: Fri, 24 Dec 2021 14:09:37 -0800 (PST)
In-Reply-To: <541dba94-b488-44e5-a939-1557f3ea9709n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:d876:5ad9:f900:90dc;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:d876:5ad9:f900:90dc
References: <sndun6$q07$1@dont-email.me> <sq372j$80q$1@dont-email.me>
<sq4l7a$21u$1@newsreader4.netcologne.de> <sq4p88$77q$1@dont-email.me>
<sq5865$1cn9$1@gal.iecc.com> <541dba94-b488-44e5-a939-1557f3ea9709n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e6872d0f-ce0b-4ff3-a4e1-3c7d2644d69bn@googlegroups.com>
Subject: Re: Macros, threat or menace, was Dense machine code from C++ code
(compiler optimizations)
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Fri, 24 Dec 2021 22:09:38 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 39
 by: MitchAlsup - Fri, 24 Dec 2021 22:09 UTC

On Friday, December 24, 2021 at 3:29:02 PM UTC-6, JimBrakefield wrote:
> On Friday, December 24, 2021 at 1:48:23 PM UTC-6, John Levine wrote:
> > According to Ivan Godard <iv...@millcomputing.com>:
> > >I quite agree - macro languages tend to be write-only. But they are true
> > >second-order, and so are very powerful. Conventional languages (absent
> > >things like C++ templates and all of SmallTalk and the like) can only do
> > >second-order by generating new program text and then running that
> > >through the compiler again.
> > >
> > >But *any* second-order programming (the program, not the language) is a
> > >non-trivial exercise. Most writers solve the intellectual tractability
> > >problem by writing first order programs in their second order language -
> > >c.f. compiling what might as well have been a C program with a C++
> > >compiler.
> > That's one of the things that PL/I did well over 50 years ago. The PL/I
> > preprocessor is a PL/I subset adeqate to do the kind of text
> > processing that preprocessors need. Considering what a rush job it was,
> > PL/I was a surprisingly good language.
> >
> > Back in my youth I recall a student PL/I setup that limited the run time
> > of a program but not the compile time, so some bright bulb wrote a
> > program that did everything in the preprocessor, generating just a
> > print statement of the result.
> >
> > --
> > Regards,
> > John Levine, jo...@taugh.com, Primary Perpetrator of "The Internet for Dummies",
> > Please consider the environment before reading this e-mail. https://jl.ly
>
> At my current level of understanding:
> An interesting feature of Zig is that instead of a macro or preprocessor the compiler
> will execute at compile time anything the can be computed at compile time
> (including type expressions). Thus the language itself is it's own preprocessor.
> And like the RTL languages, simplification and reduction is carried as far as possible.
<
If I recall correctly::
<
After compilation. the Mary compiler would start at the front of the <linked> program
and synthetically execute the program as far as possible, changing execution code
back into compile time constants. This was in 1981--how l<lack of> far we have come.

Re: Macros, threat or menace, was Dense machine code from C++ code (compiler optimizations)

<sq5hj8$mhh$1@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd4-c1ea-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Macros, threat or menace, was Dense machine code from C++ code
(compiler optimizations)
Date: Fri, 24 Dec 2021 22:28:56 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <sq5hj8$mhh$1@newsreader4.netcologne.de>
References: <sndun6$q07$1@dont-email.me> <sq372j$80q$1@dont-email.me>
<sq4l7a$21u$1@newsreader4.netcologne.de> <sq4p88$77q$1@dont-email.me>
<sq5865$1cn9$1@gal.iecc.com>
<b23bb66b-d466-4b2d-be44-ffb2c6dfceeen@googlegroups.com>
Injection-Date: Fri, 24 Dec 2021 22:28:56 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd4-c1ea-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd4:c1ea:0:7285:c2ff:fe6c:992d";
logging-data="23089"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Fri, 24 Dec 2021 22:28 UTC

MitchAlsup <MitchAlsup@aol.com> schrieb:

> But I have (still) never found a compiler so friendly with debug and warning
> messages as PL/C. I once inserted a card deck into the card reader backwards
> and the PL/C compiler found all the end-do loops ,... and even crafted meaningful
> error and warning messages that made sense to the programmer (not the compiler
> writer). If they could do that in 1973 why can't we do that today ?

https://chili-con-spiracy.com/proofreading/ comes to mind.

I've never used PL/C, but Wikipedia states (without source)

# The PL/C compiler had the unusual capability of never failing
# to compile any program, through the use of extensive automatic
# correction of many syntax errors and by converting any remaining
# syntax errors to output statements.

That sounds dubious to me, errors should be reported (in a useful
and friendly manner), but auto-correction... DWIM never really
worked.

Re: Dense machine code from C++ code (compiler optimizations)

<sq5iec$mhh$2@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.de!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd4-c1ea-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoe...@netcologne.de (Thomas Koenig)
Newsgroups: comp.arch
Subject: Re: Dense machine code from C++ code (compiler optimizations)
Date: Fri, 24 Dec 2021 22:43:24 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <sq5iec$mhh$2@newsreader4.netcologne.de>
References: <sndun6$q07$1@dont-email.me>
<dc10dfff-b48e-40ec-8c24-0a6c2e1790d2n@googlegroups.com>
<sphe6s$5a3$1@newsreader4.netcologne.de> <spqc1d$oio$1@dont-email.me>
<spqhj2$gdf$1@dont-email.me> <spqkjk$7ug$1@dont-email.me>
<86mtks1j79.fsf@linuxsc.com> <sq372j$80q$1@dont-email.me>
<sq4l7a$21u$1@newsreader4.netcologne.de> <sq515l$klf$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 24 Dec 2021 22:43:24 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd4-c1ea-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd4:c1ea:0:7285:c2ff:fe6c:992d";
logging-data="23089"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Fri, 24 Dec 2021 22:43 UTC

Guillaume <message@bottle.org> schrieb:
> Le 24/12/2021 à 15:24, Thomas Koenig a écrit :
>> Ivan Godard <ivan@millcomputing.com> schrieb:
>>> On 12/22/2021 12:24 PM, Tim Rentsch wrote:
>>> <snip>
>>>
>>>>
>>>> Not necessarily an answer but an observation: in C no new language
>>>> feature is needed, because C has the C preprocessor. It isn't hard
>>>> to write a macro that does the necessary shifting and masking (and
>>>> these days compilers are mostly smart enough to recognize the common
>>>> patterns and translate them efficiently and in machine-specific
>>>> ways).
>>>
>>> The C preprocessor is an invention of the Devil.
>>>
>>> It lacks the power of a real macro language like m4, yet has all the
>>> drawbacks of scopeless text substitution.
>>
>> You may have worked more with m4 than I have, but I have found it
>> a rather severe example of hit and miss programming. Change some
>> quoting, run m4, check against wanted results. Repeat until
>> success or total frustration is achieved.
>
> Yep. Same experience here. I also once tried replacing the C
> preprocessor with M4. After a while, I realized that it was even worse
> in terms of readability and ease of use, and not even powerful enough to
> justify that.

m4 is Turing-complete, and thus as poweful as anything else in
a computer. For use with C, if your code uses single characters,
using ' as quote character can cause issues unless you learn the
rules carefully. Or, you can use changequote.

I've been dealing with it within two environments: autoconf
configure scripts and the generated libgfortran files. Right now I
am embarked on a project which involves both, and it is heavy going.

Re: Macros, threat or menace, was Dense machine code from C++ code (compiler optimizations)

<b418acee-ca03-4491-9da3-103ee9cc0f7dn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.arch
X-Received: by 2002:ac8:5c50:: with SMTP id j16mr7409615qtj.255.1640386758969;
Fri, 24 Dec 2021 14:59:18 -0800 (PST)
X-Received: by 2002:a05:6808:1448:: with SMTP id x8mr6148181oiv.84.1640386758760;
Fri, 24 Dec 2021 14:59:18 -0800 (PST)
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: Fri, 24 Dec 2021 14:59:18 -0800 (PST)
In-Reply-To: <sq5hj8$mhh$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:291:29f0:d876:5ad9:f900:90dc;
posting-account=H_G_JQkAAADS6onOMb-dqvUozKse7mcM
NNTP-Posting-Host: 2600:1700:291:29f0:d876:5ad9:f900:90dc
References: <sndun6$q07$1@dont-email.me> <sq372j$80q$1@dont-email.me>
<sq4l7a$21u$1@newsreader4.netcologne.de> <sq4p88$77q$1@dont-email.me>
<sq5865$1cn9$1@gal.iecc.com> <b23bb66b-d466-4b2d-be44-ffb2c6dfceeen@googlegroups.com>
<sq5hj8$mhh$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b418acee-ca03-4491-9da3-103ee9cc0f7dn@googlegroups.com>
Subject: Re: Macros, threat or menace, was Dense machine code from C++ code
(compiler optimizations)
From: MitchAl...@aol.com (MitchAlsup)
Injection-Date: Fri, 24 Dec 2021 22:59:18 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 26
 by: MitchAlsup - Fri, 24 Dec 2021 22:59 UTC

On Friday, December 24, 2021 at 4:28:58 PM UTC-6, Thomas Koenig wrote:
> MitchAlsup <Mitch...@aol.com> schrieb:
> > But I have (still) never found a compiler so friendly with debug and warning
> > messages as PL/C. I once inserted a card deck into the card reader backwards
> > and the PL/C compiler found all the end-do loops ,... and even crafted meaningful
> > error and warning messages that made sense to the programmer (not the compiler
> > writer). If they could do that in 1973 why can't we do that today ?
> https://chili-con-spiracy.com/proofreading/ comes to mind.
>
> I've never used PL/C, but Wikipedia states (without source)
>
> # The PL/C compiler had the unusual capability of never failing
> # to compile any program, through the use of extensive automatic
> # correction of many syntax errors and by converting any remaining
> # syntax errors to output statements.
>
> That sounds dubious to me, errors should be reported (in a useful
> and friendly manner), but auto-correction... DWIM never really
> worked.
<
I am not really praising the auto-correction, but the complete diagnostic
of whatever got fed to the compiler. Today's compilers tend to give a
couple of handfuls of error messages, then just quit.
<
Secondarily, the errors were readable to someone never inside of a compiler
before with ASCII pointers to character at which the error was first detected--
not just the line on which the error occurred.

Re: Macros, threat or menace, was Dense machine code from C++ code (compiler optimizations)

<sq5m82$ich$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bak...@iitbombay.org (Bakul Shah)
Newsgroups: comp.arch
Subject: Re: Macros, threat or menace, was Dense machine code from C++ code
(compiler optimizations)
Date: Fri, 24 Dec 2021 15:48:18 -0800
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <sq5m82$ich$1@dont-email.me>
References: <sndun6$q07$1@dont-email.me> <sq372j$80q$1@dont-email.me>
<sq4l7a$21u$1@newsreader4.netcologne.de> <sq4p88$77q$1@dont-email.me>
<sq5865$1cn9$1@gal.iecc.com>
<b23bb66b-d466-4b2d-be44-ffb2c6dfceeen@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 24 Dec 2021 23:48:18 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="52b9036af83fdd963810430d4ec83f0d";
logging-data="18833"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19/dlAM5H/vQS8YOKZmZQ4z"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:68.0)
Gecko/20100101 Firefox/68.0 SeaMonkey/2.53.10.1
Cancel-Lock: sha1:ZTUpR+wGR+di4bn3XvuvBN546AQ=
In-Reply-To: <b23bb66b-d466-4b2d-be44-ffb2c6dfceeen@googlegroups.com>
 by: Bakul Shah - Fri, 24 Dec 2021 23:48 UTC

On 12/24/21 1:27 PM, MitchAlsup wrote:
> But I have (still) never found a compiler so friendly with debug and warning
> messages as PL/C. I once inserted a card deck into the card reader backwards
> and the PL/C compiler found all the end-do loops ,... and even crafted meaningful
> error and warning messages that made sense to the programmer (not the compiler
> writer). If they could do that in 1973 why can't we do that today ?

PL/C is what they used to teach programming (at least in some classes)
at USC. But many students were puzzled when they did exactly what the
PL/C compiler said it did to continue compiling their program and
it still didn't work :-)

The macro languages of Scheme and Common Lisp are quite powerful.
CL's much more so than Scheme's. But these languages are not very
popular.

Re: Macros, threat or menace, was Dense machine code from C++ code (compiler optimizations)

<sq5mga$k9o$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bak...@iitbombay.org (Bakul Shah)
Newsgroups: comp.arch
Subject: Re: Macros, threat or menace, was Dense machine code from C++ code
(compiler optimizations)
Date: Fri, 24 Dec 2021 15:52:40 -0800
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <sq5mga$k9o$1@dont-email.me>
References: <sndun6$q07$1@dont-email.me> <sq372j$80q$1@dont-email.me>
<sq4l7a$21u$1@newsreader4.netcologne.de> <sq4p88$77q$1@dont-email.me>
<sq5865$1cn9$1@gal.iecc.com>
<541dba94-b488-44e5-a939-1557f3ea9709n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 24 Dec 2021 23:52:42 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="52b9036af83fdd963810430d4ec83f0d";
logging-data="20792"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX193uDvyPBX0ok9hzVOB0SMO"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:68.0)
Gecko/20100101 Firefox/68.0 SeaMonkey/2.53.10.1
Cancel-Lock: sha1:Dj28XP5U6L/XlshoVDlFwyQUbII=
In-Reply-To: <541dba94-b488-44e5-a939-1557f3ea9709n@googlegroups.com>
 by: Bakul Shah - Fri, 24 Dec 2021 23:52 UTC

On 12/24/21 1:29 PM, JimBrakefield wrote:
> At my current level of understanding:
> An interesting feature of Zig is that instead of a macro or preprocessor the compiler
> will execute at compile time anything the can be computed at compile time
> (including type expressions). Thus the language itself is it's own preprocessor.
> And like the RTL languages, simplification and reduction is carried as far as possible.

The "V" language also does this. But this is not the same as decent
macro processing. Scheme/CL macros allow you to abstract away details
very nicely but for that to work, there needs to a language syntax model
the macros can access. This is much simpler in S-expr languages since
the AST *is* the concrete syntax (more or less)!

Re: Macros, threat or menace, was Dense machine code from C++ code (compiler optimizations)

<sq65vu$pcc$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: iva...@millcomputing.com (Ivan Godard)
Newsgroups: comp.arch
Subject: Re: Macros, threat or menace, was Dense machine code from C++ code
(compiler optimizations)
Date: Fri, 24 Dec 2021 20:17:01 -0800
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <sq65vu$pcc$1@dont-email.me>
References: <sndun6$q07$1@dont-email.me> <sq372j$80q$1@dont-email.me>
<sq4l7a$21u$1@newsreader4.netcologne.de> <sq4p88$77q$1@dont-email.me>
<sq5865$1cn9$1@gal.iecc.com>
<541dba94-b488-44e5-a939-1557f3ea9709n@googlegroups.com>
<sq5mga$k9o$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 25 Dec 2021 04:17:02 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="49fb671ecae1fabc97e23bc3ec74929a";
logging-data="25996"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX197lt3pnlIpblUSdjOCbxwA"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.4.1
Cancel-Lock: sha1:uGDMNTdL4rLv7XGAv7FbAgiKYwM=
In-Reply-To: <sq5mga$k9o$1@dont-email.me>
Content-Language: en-US
 by: Ivan Godard - Sat, 25 Dec 2021 04:17 UTC

On 12/24/2021 3:52 PM, Bakul Shah wrote:
> On 12/24/21 1:29 PM, JimBrakefield wrote:
>> At my current level of understanding:
>> An interesting feature of Zig is that instead of a macro or
>> preprocessor the compiler
>> will execute at compile time anything the can be computed at compile time
>> (including type expressions).  Thus the language itself is it's own
>> preprocessor.
>> And like the RTL languages, simplification and reduction is carried as
>> far as possible.
>
> The "V" language also does this. But this is not the same as decent
> macro processing. Scheme/CL macros allow you to abstract away details
> very nicely but for that to work, there needs to a language syntax model
> the macros can access. This is much simpler in S-expr languages since
> the AST *is* the concrete syntax (more or less)!

SmallTalk had the execution context accessible and mutable by the
running program, including during translation. Rarely used but immensely
powerful. I once did a co-routine system where "visit" severed the call
stack in the middle and rehooked it to the top of the call stack of the
visitee.

But second order usage is hard to grok. Unfortunately, reality is second
order. Probably has to be, or it wouldn't be real. That's an example.

Re: Macros, threat or menace, was Dense machine code from C++ code (compiler optimizations)

<8735mh85p8.fsf@eder.anydns.info>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: a_eder_...@web.de (Andreas Eder)
Newsgroups: comp.arch
Subject: Re: Macros, threat or menace, was Dense machine code from C++ code (compiler optimizations)
Date: Sat, 25 Dec 2021 09:11:15 +0100
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <8735mh85p8.fsf@eder.anydns.info>
References: <sndun6$q07$1@dont-email.me> <sq372j$80q$1@dont-email.me>
<sq4l7a$21u$1@newsreader4.netcologne.de> <sq4p88$77q$1@dont-email.me>
<sq5865$1cn9$1@gal.iecc.com>
<b23bb66b-d466-4b2d-be44-ffb2c6dfceeen@googlegroups.com>
<sq5m82$ich$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="ad67c703ae5eb6fc4b42c6558460a85e";
logging-data="15710"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18p9rm/eYfcRf4m5VyAFlph"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Cancel-Lock: sha1:D/2exEgsWGEMqK6VQXEg1lfM14k=
sha1:7XviRE/UezA6dKr4U6WWzzoV1iM=
 by: Andreas Eder - Sat, 25 Dec 2021 08:11 UTC

On Fr 24 Dez 2021 at 15:48, Bakul Shah <bakul@iitbombay.org> wrote:

> The macro languages of Scheme and Common Lisp are quite powerful.
This is true.

> CL's much more so than Scheme's.
That is not so. Theoretically (and practically) thet are on the same
level, but Scheme has several different macro systems - even a hygienic
one.

>But these languages are not very popular.
Unfortunately, that's true.

Happy Xmas,

'Andreas

Re: Macros, threat or menace, was Dense machine code from C++ code (compiler optimizations)

<sq6p1d$8ch$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: bak...@iitbombay.org (Bakul Shah)
Newsgroups: comp.arch
Subject: Re: Macros, threat or menace, was Dense machine code from C++ code
(compiler optimizations)
Date: Sat, 25 Dec 2021 01:42:03 -0800
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <sq6p1d$8ch$1@dont-email.me>
References: <sndun6$q07$1@dont-email.me> <sq372j$80q$1@dont-email.me>
<sq4l7a$21u$1@newsreader4.netcologne.de> <sq4p88$77q$1@dont-email.me>
<sq5865$1cn9$1@gal.iecc.com>
<b23bb66b-d466-4b2d-be44-ffb2c6dfceeen@googlegroups.com>
<sq5m82$ich$1@dont-email.me> <8735mh85p8.fsf@eder.anydns.info>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 25 Dec 2021 09:42:05 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="52b9036af83fdd963810430d4ec83f0d";
logging-data="8593"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183Qec5vUNtD1xlRzFRYz3+"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:68.0)
Gecko/20100101 Firefox/68.0 SeaMonkey/2.53.10.1
Cancel-Lock: sha1:jXJSiaRUvHevI84uJ2FB643ZcmQ=
In-Reply-To: <8735mh85p8.fsf@eder.anydns.info>
 by: Bakul Shah - Sat, 25 Dec 2021 09:42 UTC

On 12/25/21 12:11 AM, Andreas Eder wrote:
> On Fr 24 Dez 2021 at 15:48, Bakul Shah <bakul@iitbombay.org> wrote:
>
>> The macro languages of Scheme and Common Lisp are quite powerful.
> This is true.
>
>> CL's much more so than Scheme's.
> That is not so. Theoretically (and practically) thet are on the same
> level, but Scheme has several different macro systems - even a hygienic
> one.

Note that I am not an expert in this area but everything I
have read so far says CL macros are more powerful than
Scheme's. Scheme's are *safer* but less powerful. See for
instance
https://letoverlambda.com/index.cl/guest/chap3.html#sec_4
where the author says:
Hygienic macros are, in the best of situations, a beginner's
safety guard-rail; in the worst of situations they form an
electric fence, trapping their victims in a sanitised,
capture-safe prison. Furthermore, recent research has shown
that hygienic macro systems like those specified by various
Scheme revisions can still be vulnerable to many interesting
capture problems

Mind you, I vastly prefer Scheme purely for aesthetics and
simplicity reasons. Not that it matters since I never wrote
Scheme or CL code for a living.

>> But these languages are not very popular.
> Unfortunately, that's true.

Yup. Very unfortunate.

>
> Happy Xmas,
>
> 'Andreas
>

Re: Macros, threat or menace, was Dense machine code from C++ code (compiler optimizations)

<87r1a07qft.fsf@eder.anydns.info>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: a_eder_...@web.de (Andreas Eder)
Newsgroups: comp.arch
Subject: Re: Macros, threat or menace, was Dense machine code from C++ code (compiler optimizations)
Date: Sat, 25 Dec 2021 14:40:54 +0100
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <87r1a07qft.fsf@eder.anydns.info>
References: <sndun6$q07$1@dont-email.me> <sq372j$80q$1@dont-email.me>
<sq4l7a$21u$1@newsreader4.netcologne.de> <sq4p88$77q$1@dont-email.me>
<sq5865$1cn9$1@gal.iecc.com>
<b23bb66b-d466-4b2d-be44-ffb2c6dfceeen@googlegroups.com>
<sq5m82$ich$1@dont-email.me> <8735mh85p8.fsf@eder.anydns.info>
<sq6p1d$8ch$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="ad67c703ae5eb6fc4b42c6558460a85e";
logging-data="20275"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19/0YlFocfSzPtOn7QKtwrx"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Cancel-Lock: sha1:Z/zd5Vi1cZ+eutU2jc57VszsPhk=
sha1:NKSyCLrzbBOp2GLed9TNvY7DBRI=
 by: Andreas Eder - Sat, 25 Dec 2021 13:40 UTC

On Sa 25 Dez 2021 at 01:42, Bakul Shah <bakul@iitbombay.org> wrote:

> On 12/25/21 12:11 AM, Andreas Eder wrote:
>> On Fr 24 Dez 2021 at 15:48, Bakul Shah <bakul@iitbombay.org> wrote:
>>
>>> The macro languages of Scheme and Common Lisp are quite powerful.
>> This is true.
>>
>>> CL's much more so than Scheme's.
>> That is not so. Theoretically (and practically) thet are on the same
>> level, but Scheme has several different macro systems - even a hygienic
>> one.
>
> Note that I am not an expert in this area but everything I
> have read so far says CL macros are more powerful than
> Scheme's. Scheme's are *safer* but less powerful. See for
> instance
> https://letoverlambda.com/index.cl/guest/chap3.html#sec_4
> where the author says:
> Hygienic macros are, in the best of situations, a beginner's
> safety guard-rail; in the worst of situations they form an
> electric fence, trapping their victims in a sanitised,
> capture-safe prison. Furthermore, recent research has shown
> that hygienic macro systems like those specified by various
> Scheme revisions can still be vulnerable to many interesting
> capture problems

The problem with Scheme is, that there are different standards (RxRS for
x from 5 to 7) but in a scheme that supports syntax-case zou can define
CL's defmacro and some implementations already have it (maybe under yhe
name of define-macro).

For more about that topic you should read
https://stackoverflow.com/questions/19664993/is-it-possible-to-implement-common-lisps-macro-system-in-scheme

That should clarify the point better than I could here.

'Andreas

Second-order programming (was: Dense machine code from C++ code)

<2021Dec25.172653@mips.complang.tuwien.ac.at>

  copy mid

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

  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: Second-order programming (was: Dense machine code from C++ code)
Date: Sat, 25 Dec 2021 16:26:53 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 37
Message-ID: <2021Dec25.172653@mips.complang.tuwien.ac.at>
References: <sndun6$q07$1@dont-email.me> <dc10dfff-b48e-40ec-8c24-0a6c2e1790d2n@googlegroups.com> <sphe6s$5a3$1@newsreader4.netcologne.de> <spqc1d$oio$1@dont-email.me> <spqhj2$gdf$1@dont-email.me> <spqkjk$7ug$1@dont-email.me> <86mtks1j79.fsf@linuxsc.com> <sq372j$80q$1@dont-email.me> <sq4l7a$21u$1@newsreader4.netcologne.de> <sq4p88$77q$1@dont-email.me>
Injection-Info: reader02.eternal-september.org; posting-host="70510cc33546f9e44e24374914364b6e";
logging-data="32179"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+yOmKgmO/LmjjOjVqs1aT4"
Cancel-Lock: sha1:mQFgzZXg+gFcEUAec79XEWTQFW4=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Sat, 25 Dec 2021 16:26 UTC

Ivan Godard <ivan@millcomputing.com> writes:
>I quite agree - macro languages tend to be write-only. But they are true
>second-order, and so are very powerful. Conventional languages (absent
>things like C++ templates and all of SmallTalk and the like) can only do
>second-order by generating new program text and then running that
>through the compiler again.

Most interactive languages are "the like", because it's something the
system has to implement anyway. Some offer just a string-based
interface, some also provide access to other levels. Lisp's
S-Expressions have been mentioned.

>But *any* second-order programming (the program, not the language) is a
>non-trivial exercise.

It seems to me that, like all programming, it's a matter of the amount
of exercise. If you program rarely, any programming is a non-trivial
exercise. If you second-order program rarely, every second-order
program is a non-trivial exercise. I have seen cases where a
second-order Forth program was simpler than a single-level program for
the same problem (but am too lazy to search for it right now). And
yet, some of the work I have done in recent times has been for
facilitating single-level programming (in particular, by adding
closures), but I have also added features for making second-order
programming easier.

>Most writers solve the intellectual tractability
>problem by writing first order programs in their second order language -

If these languages are different (as in C++ and C), that's of course a
particular hurdle that makes the whole thing much harder and less
trivial.

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

Re: Macros, threat or menace, was Dense machine code from C++ code (compiler optimizations)

<OTJxJ.174251$831.148123@fx40.iad>

  copy mid

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

  copy link   Newsgroups: comp.arch
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx40.iad.POSTED!not-for-mail
From: ThatWoul...@thevillage.com (EricP)
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
Newsgroups: comp.arch
Subject: Re: Macros, threat or menace, was Dense machine code from C++ code
(compiler optimizations)
References: <sndun6$q07$1@dont-email.me> <sq372j$80q$1@dont-email.me> <sq4l7a$21u$1@newsreader4.netcologne.de> <sq4p88$77q$1@dont-email.me> <sq5865$1cn9$1@gal.iecc.com> <b23bb66b-d466-4b2d-be44-ffb2c6dfceeen@googlegroups.com> <sq5hj8$mhh$1@newsreader4.netcologne.de>
In-Reply-To: <sq5hj8$mhh$1@newsreader4.netcologne.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 51
Message-ID: <OTJxJ.174251$831.148123@fx40.iad>
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Sat, 25 Dec 2021 19:01:02 UTC
Date: Sat, 25 Dec 2021 14:00:42 -0500
X-Received-Bytes: 3377
 by: EricP - Sat, 25 Dec 2021 19:00 UTC

Thomas Koenig wrote:
> MitchAlsup <MitchAlsup@aol.com> schrieb:
>
>> But I have (still) never found a compiler so friendly with debug and warning
>> messages as PL/C. I once inserted a card deck into the card reader backwards
>> and the PL/C compiler found all the end-do loops ,... and even crafted meaningful
>> error and warning messages that made sense to the programmer (not the compiler
>> writer). If they could do that in 1973 why can't we do that today ?
>
> https://chili-con-spiracy.com/proofreading/ comes to mind.
>
> I've never used PL/C, but Wikipedia states (without source)
>
> # The PL/C compiler had the unusual capability of never failing
> # to compile any program, through the use of extensive automatic
> # correction of many syntax errors and by converting any remaining
> # syntax errors to output statements.
>
> That sounds dubious to me, errors should be reported (in a useful
> and friendly manner), but auto-correction... DWIM never really
> worked.

About 25 or so years ago I wrote an LALR(1) table generator and parser
with autocorrect. Autocorrect worked quite well.

Autocorrect was 'a thing' back when compiles were so expensive,
batch jobs on time share systems with minutes to hours turn around,
that you wanted to correct as many errors as possible for each run.

Autocorrect would replace, insert, or delete multiple tokens to discover
the lowest cost repair sequence and had configurable limits on number of
valid tokens after a repair to shift to declare a repair valid,
and a time limit to spend looking for better repairs.

It used a breadth-first search to discover any repair,
which sets an upper limit for repair costs,
then burrows down depth-first to discover better repairs,
fetching ahead tokens in the input stream validating future sequences too.

Parser was a deferred reduction parser so it could step backwards
one reduction and try to replace,insert,delete in earlier sequences.

It can't create identifiers so repairing a syntax error by inserting
an Identifier can lead to a semantic error later, but the inserted
tokens were marked so their semantic error messages can be suppressed.
But it could plow through syntax errors and keep compiling.

I've given it C, Java and Ada syntaxes and tested it by pounding
on the keyboard. It would spit out correct syntax.

Pages:12345678
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor