Monday, September 7, 2020

Digest for comp.lang.c++@googlegroups.com - 25 updates in 7 topics

Lynn McGuire <lynnmcguire5@gmail.com>: Sep 06 11:15PM -0500

"C++20 approved, C++23 meetings and schedule update" by Herb Sutter

https://herbsutter.com/2020/09/06/c20-approved-c23-meetings-and-schedule-update/
 
"On Friday September 4, C++20's DIS (Draft International Standard)
ballot ended, and it passed unanimously. This means that C++20 has now
received final technical approval and is done with ISO balloting, and we
expect it to be formally published toward the end of 2020 after we
finish a final round of ISO editorial work."
 
"As always, we are not counting on ISO's publication speed to call it
C++20, it's C++20 because WG21 completed technical work in February. If
for some reason ISO needs until January to get it out the door and
assigns it a 2021 publication date, the standard will still be referred
to as C++20. That is already its industry name, and 300,000+ search hits
can't be (retroactively made) wrong!"
https://www.google.com/search?q=%22c%2B%2B20%22
 
Lynn
Brian Wood <woodbrian77@gmail.com>: Sep 07 09:30AM -0700

On Sunday, September 6, 2020 at 11:15:31 PM UTC-5, Lynn McGuire wrote:
> received final technical approval and is done with ISO balloting, and we
> expect it to be formally published toward the end of 2020 after we
> finish a final round of ISO editorial work."
 
I think the jury is still out on 2020 C++. My experience so
far has been that it's not got a lot for me:
 
https://github.com/Ebenezer-group/onwards
 
Brian
Ebenezer Enterprises - Enjoying programming again.
https://webEbenezer.net
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 07 06:04PM +0100

On 07/09/2020 17:30, Brian Wood wrote:
 
> Brian
> Ebenezer Enterprises - Enjoying programming again.
> https://webEbenezer.net
 
Why do you keep doing this? The only point of this post is to advertise your link which wouldn't be so egregious if you didn't try to disguise it with the vapid introduction.
 
Spammer, be gone!
 
/Flibble
 
--
"Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin
 
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say."
Brian Wood <woodbrian77@gmail.com>: Sep 07 12:32PM -0700

On Monday, September 7, 2020 at 12:05:03 PM UTC-5, Mr Flibble wrote:
> > Ebenezer Enterprises - Enjoying programming again.
> > https://webEbenezer.net
> Why do you keep doing this? The only point of this post is to advertise your link which wouldn't be so egregious if you didn't try to disguise it with the vapid introduction.
 
Just giving some context.
 
> Spammer, be gone!
 
Do you have a mirror, Flibble?
Mike Terry <news.dead.person.stones@darjeeling.plus.com>: Sep 07 01:47AM +0100

On 06/09/2020 18:22, olcott wrote:
 
>> Will you be making the emulator (source code) available as part of
>> your delivery?
 
> Better than that, I will be making it available first.
 
That's good!
 
>> entry point?
 
> The assumption is that the COFF file is generated by a Microsoft "C"
> compiler, thus the entry point is always main().
 
ok
 
> [00bc] f4 hlt
 
> The halt decider is executed this same way, returning a value to main()
> this same way.
 
ok, that's not how I would do it, but it's workable I guess. At least,
it's enough for deciders which only have to return a binary decision.
 
> void DebugStep(u32* master_state, u32* slave_state);
 
> Each user code UTM equivalent can be the master to its own slave to an
> arbitrary recursion depth.
 
You've missed the point of my question. I wanted to know how my add
routine would receive its two inputs. What I /originally/ expected was
that I would code my Add "TM" in C as
 
int AddTM (int a, int b)
{
return a+b;
}
 
and somehow the values for a and b would be supplied on the shell
command line when invoking the emulator, so the emulator would start
execution of AddTM having placed a and b on the stack as expected by the
C code of AddTM. E.g. if I wanted it to add 3 and 4, something like:
x86utm.exe Filename.obj parm(int:3) parm(int:4)
 
NOW, building on how you've explained handling of return values, I'm
guessing input parms will be handled in essentially the same way: main()
will act as a wrapper for the actual "TM" (the AddTM routine) as follows:
 
// "C" Source code
int AddTM (int a, int b)
{
return a+b;
}
 
int main()
{
AddTM (3, 4);
__asm hlt
}
 
...so the source code contains not just the "TM", but a little wrapper
to call it, including the input supplied to the "TM". (In my example
the wrapper is main() which has hard coded literals for 3, 4.) If I
change my mind and want to run it to add 5, 84, I can (must) change the
code and recompile it to a new COFF file.
 
Is this right? (It's an ok approach, easy for you to develop.)
 
If so, I can move on to my first serious question!
 
Mike.
olcott <NoOne@NoWhere.com>: Sep 06 08:18PM -0500

On 9/6/2020 7:47 PM, Mike Terry wrote:
> {
>     return a+b;
> }
 
int main()
int N = AddTM(56,93);
}
 
>   AddTM (3, 4);
>   __asm hlt
> }
 
Exactly!
 
> ...so the source code contains not just the "TM", but a little wrapper
 
Just the cconventional main()
 
> change my mind and want to run it to add 5, 84, I can (must) change the
> code and recompile it to a new COFF file.
 
> Is this right?  (It's an ok approach, easy for you to develop.)
 
Yes.
 
> If so, I can move on to my first serious question!
 
> Mike.
 
OK
 
 
--
Copyright 2020 Pete Olcott
olcott <NoOne@NoWhere.com>: Sep 07 12:16AM -0500

On 9/6/2020 7:47 PM, Mike Terry wrote:
>> this same way.
 
> ok, that's not how I would do it, but it's workable I guess.  At least,
> it's enough for deciders which only have to return a binary decision.
The idea is to make it as much like a Turing machine as possible and yet
allow "C" to be its programming language. All of its memory is a single
contiguous block as if it was a Turing machine tape.
 
For Turing machines all the "input" is already on the tape or it doesn't
exist.
 
--
Copyright 2020 Pete Olcott
Mike Terry <news.dead.person.stones@darjeeling.plus.com>: Sep 07 07:04PM +0100

On 07/09/2020 02:18, olcott wrote:
>> the code and recompile it to a new COFF file.
 
>> Is this right? (It's an ok approach, easy for you to develop.)
 
> Yes.
 
ok, so now what about the (partial) halt decider H. How does H receive
its input data? As above, it would be passed the input by main(), but
how will that input be represented?
 
This has to take as input two parameters:
 
1) A TM description
2) A runtime data parm
 
It seems to me there are at least a couple of reasonable approaches:
 
- Represent both as arrays of bytes with a supplied length. The TM
description would be the /contents/ of the COFF file.
 
- Represent both as strings. The TM description would be the /name/ of
the COFF file.
 
The most "logical" approach (which respects the original intention of
the Linz definitions) is the array of bytes, but due to the other
architectural choices you've made, this way leads to a few headaches!
 
The strings approach /could/ work specifically for your purposes,
although not as a /general/ approach for working with halting TMs. The
problem with this as a general approach is that the TM ought to be able
to examine all aspects of the input TM to make its decision, but it
can't do that if all it has is a file name. (Or at least, it can't do
this unless you also include file I/O in your TM C spec, and you've
already said "no library functions". But maybe your specific H doesn't
need to examine the COFF data in this fashion.
 
Anyway, which way are you planning to go on this question?
 
Regards,
Mike.
olcott <NoOne@NoWhere.com>: Sep 07 01:43PM -0500

On 9/7/2020 1:04 PM, Mike Terry wrote:
 
> ok, so now what about the (partial) halt decider H.  How does H receive
> its input data?  As above, it would be passed the input by main(), but
> how will that input be represented?
 
I have a perfect answer that I was going to post that I just now decided
to make trade secret for about one month. I don't want someone to take
my hints and publish my solution before I do.
 
--
Copyright 2020 Pete Olcott
red floyd <no.spam.here@its.invalid>: Sep 04 11:09AM -0700

On 9/3/2020 9:44 PM, Jeff Barnett wrote:
[redacted]
> a day for sleep. I assume that you don't have a pet, a live in person
> with whom you interact, or any hobbies. If any of these assumptions are
> false, there's even less sleep.
 
Minor math error. There are 168 hours in a week. 168-122 = 46. He has
just over 6 hours to sleep, and do anything else.
olcott <NoOne@NoWhere.com>: Sep 04 01:34PM -0500

On 9/4/2020 1:09 PM, red floyd wrote:
>> false, there's even less sleep.
 
> Minor math error. There are 168 hours in a week. 168-122 = 46. He has
> just over 6 hours to sleep, and do anything else.
 
Between discussing this on the internet and the software engineering of
my x86 based UTM equivalent I spent at least twelve hours per day six
days per week and only 8 hours on my day of rest.
 
I usually get between 7 and 8 hours per night of sleep, I take many
short-cuts to greatly reduce the other normal daily chores. For example
daily food preparation takes about two minutes per five small meals.
Roasting a chicken once per week takes less that 30 minutes of labor
including packaging the portions. Grocery shopping is point and click.
 
--
Copyright 2020 Pete Olcott
"André G. Isaak" <agisaak@gm.invalid>: Sep 05 03:29PM -0600

On 2020-09-05 14:31, olcott wrote:
 
>> If the HDC does not determine what will happen, it violates its
>> requirement as a HDC, and is thus incorrect.
 
> There is a loophole.
 
And what is this loophole?
 
André
 
 
--
To email remove 'invalid' & replace 'gm' with well known Google mail
service.
"André G. Isaak" <agisaak@gm.invalid>: Sep 05 03:52PM -0600

On 2020-09-05 14:31, olcott wrote:
 
> When we actually see H correctly deciding an instance of H_Hat we find
> that prior understanding of the Halting Problem as impossible by
> definition is an incorrect understanding.
 
Since you claim to have have had your solution "fully encoded" at one
time, then you should be able to answer the following very simple question:
 
When given your <Ĥ, Ĥ> as input, does your program claim that this halts
or that it doesn't halt. No need to provide any details of how it
arrives at the answer -- you can continue to keep that secret -- I just
want to know what answer it actually gives.
 
André
 
--
To email remove 'invalid' & replace 'gm' with well known Google mail
service.
olcott <NoOne@NoWhere.com>: Sep 05 12:40AM -0500

On 9/4/2020 11:50 PM, André G. Isaak wrote:
> purely hypothetical TM which is claimed to decide halting for every
> possible input but whose workings are not described.
 
> André
 
Linz provides a very simple state machine definition of H.
It has one start state (q0) and two final states ((qy)) and ((qn))
having a wildcard state transitions in-between.
 
The H_Hat variation merely prepends a well defined state (copy input)
and appends a pair of infinite loop states.
 
The key unspecified aspect of these machines is the transition from (q0)
to (qy) or (qn). Everything else is totally specified.
 
These wildcard state transitions essentially allow any computation that
gets the right answer. This all boils down to anything that I specify
that gets the right answer in-between (q0) and (qy) or (qn) counts as
valid.
 
http://www.liarparadox.org/Peter_Linz_HP(Pages_315-320).pdf
 
--
Copyright 2020 Pete Olcott
Richard Damon <Richard@Damon-Family.org>: Sep 05 09:12PM -0400

On 9/5/20 7:52 PM, Jeff Barnett wrote:
> ever see a TM or equivalent encoding for H.
 
>> But he's not going to give any details, so we'll just have to wait and
>> see...
 
My first guess, is that he somehow thinks that if H doesn't say Halted,
that is good enough to be considered as the 'Not Halting' answer, when
of course it isn't. That or some other 'small' change to the ground
rules, that would actually allow H to be something trivial or
uninteresting, so proving that this modified H can exist actully means
nothing.
Juha Nieminen <nospam@thanks.invalid>: Sep 04 07:19PM

> Can anyone think of an even more simple way?
 
Since you are asking a C++ group, you could write it in C++ (or C),
but I don't know if it would be the simplest way. (Well, after it
has been implemented an compiled it will become really simple.)
 
But it would certainly be extremely efficient.
 
Of course implementing it depends on your requirements. What is
the exact input syntax? Is whitespace allowed (and to be ignored)?
What should happen if the input contains non-hexadecimal characters?
Should the program support input files and/or output files as
command-line parameters?
legalize+jeeves@mail.xmission.com (Richard): Sep 04 07:38PM

[Please do not mail me a copy of your followup]
 
Frederick Gotham <cauldwell.thomas@gmail.com> spake the secret code
 
>Can anyone think of an even more simple way?
 
Why not write your own?
 
#include <cstdio>
 
int main(int argc, char *argv[])
{
while (!std::feof(stdin))
{
int val{};
if (std::scanf("%2x", &val) == 1)
{
std::printf("%c", static_cast<char>(val));
}
}
return 0;
}
 
> echo 22 | ./a.out
"
> (echo 22; echo 22) | ./a.out
""
 
scanf will skip interposing whitespace when parsing integers. You can
add additional whitespace handling if that is what you need.
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Terminals Wiki <http://terminals-wiki.org>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 04 09:12PM +0100

On 04/09/2020 18:38, Frederick Gotham wrote:
 
> Like this:
 
> some_other_program | sed 's/../\\x&/g' | xargs echo -e
 
> Can anyone think of an even more simple way?
 
You are mistaken, macOS is not similar to UNIX, macOS *is* UNIX.
 
/Flibble
 
--
"Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin
 
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say."
Keith Thompson <Keith.S.Thompson+u@gmail.com>: Sep 04 01:54PM -0700

> }
> return 0;
> }
 
I advise against using feof() to determine whether there's any remaining
input. The above will be an infinite loop if there's an input error.
Use the value returned by the input function. (In this case, scanf()
returns EOF on end-of-file or an input error.)
 
[...]
 
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips Healthcare
void Void(void) { Void(); } /* The recursive call of the void */
RM <robert_magdziarz@wp.pl>: Sep 04 04:44PM +0200

I am programming PHP obfuscator in C++.
I want to encode PHP string literals. I want to encode PHP code treated
as text:
 
namespace app\assets;
use yii\web\AssetBundle;
class AppAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'css/site.css',
];
public $js = [
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
];
}
 
into text:
 
namespace app\assets;
define('gkvxplzzsz_y_y_', 'yii\bootstrap\BootstrapAsset');
define('gbajlprgjb_y_y_', 'yii\web\YiiAsset'); define('ufapteqrhz_y_y_',
'css/site.css'); define('zgvjafbnir_y_y_', '@webroot');
define('gyoltyituv_y_y_', '@web');
use yii\web\AssetBundle;
class AppAsset extends AssetBundle
{
public $basePath = zgvjafbnir_y_y_;
public $baseUrl = gyoltyituv_y_y_;
public $css = [
ufapteqrhz_y_y_,
];
public $js = [
];
public $depends = [
gbajlprgjb_y_y_,
gkvxplzzsz_y_y_,
];
}
 
To achieve this I wrote C++ function:
 
string insert_string_defines(const string &defines, const string &subject) {
size_t pos = subject.find("<?php");
if (pos == string::npos) {
return subject;
}
regex
re_namespace(R"((declare(\s|\n)*\([A-Za-z0-9_=\s]+\)(\s|\n)*;(\s|\n)*)*namespace\s+([A-Za-z0-9_\\]+)(\s|\n)+;)"
/* regex::extended */);
// optional namespace definition must occur before almost anything
(PHP syntax requirement):
string s = subject.substr(0, pos) +
regex_replace(subject.substr(pos), re_namespace, "$1\nnamespace $2;\n" +
defines);
if (s != subject) {
return s;
}
return subject.substr(0, pos) + "<?php\n" + defines + '\n' +
subject.substr(pos + 5);
}
 
I failed to find C++ regex tester in WWW, thus I don't know what's wrong
with my regex. Please help.
RM <robert_magdziarz@wp.pl>: Sep 05 10:28AM +0200

I tried to write my own C++ regex tester, but it doesn't work for
multiline input, I don't know why.
 
 
/*
Simple regex tester
Gets regex, reads text from standard input, writes matches to standard
output
*/
 
#include <iostream>
#include <string>
#include <regex>
 
using namespace std;
 
int main(int argc, char *argv[]) {
if (argc != 2) {
cerr << "Usage: " << argv[0] << " regular_expression
<input_file" << endl;
return EXIT_FAILURE;
}
regex re(argv[1], std::regex_constants::multiline);
stringstream buffer;
buffer << cin.rdbuf();
string text = buffer.str();
cmatch cm;
regex_match(text.c_str(), cm, re);
for (unsigned int i = 0; i < cm.size(); ++i) {
cout << cm.str(i) << endl;
}
return EXIT_SUCCESS;
}
RM <robert_magdziarz@wp.pl>: Sep 05 12:58PM +0200

W dniu 05.09.2020 o 10:28, RM pisze:
>     }
>     return EXIT_SUCCESS;
> }
 
I also tried (std::regex_constants::match_not_bol |
std::regex_constants::match_not_eol), without success.
 
match_not_bol Not Beginning-Of-Line The first character is not
considered a beginning of line ("^" does not match).
match_not_eol Not End-Of-Line The last character is not considered an
end of line ("$" does not match).
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 05 09:34PM +0100

On 05/09/2020 18:27, Brian Wood wrote:
 
> They stab it with their steely knives, but they just
> can't kill the truth. I'd be happy to work with that
> prof.
 
That is because you are a bigot like him. Fuck off twat.
 
/Flibble
 
--
"Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin
 
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say."
olcott <NoOne@NoWhere.com>: Sep 05 11:38AM -0500

There is no possible way for any concrete implementation of "C" to be
made equivalent to a Turing machine. If we used every atom in the whole
universe to each store a single binary digit we would still be woefully
short of unlimited memory.
 
We can override and supersede the standard "C" and map its syntax and
semantics to an abstract model of computation that is Turing equivalent.
The RASP model of computation is a model that "C" can be mapped to.
https://en.wikipedia.org/wiki/Random-access_stored-program_machine
 
A variation of the RASP model is shown below that the x86/x64 language
maps to. Since it is already known that "C" maps to the x86/x64 concrete
models of computation we know that "C" maps to the following abstract model:
 
Instruction
: INTEGER ":" OPCODE // Address:Opcode
| INTEGER ":" OPCODE INTEGER // Address:Opcode Operand
| INTEGER ":" OPCODE INTEGER "," INTEGER // Address:Opcode
Operand, Operand
HEXDIGIT [a-fA-F0-9]
INTEGER {HEXDIGIT}+
OPCODE HEXDIGIT{4}
 
The above abstract machine maps the x86 language to machines with a
fixed pointer size of the largest unlimited integer address that is
actually needed by the computation. This provides the basis for
recognizing the set of Turing equivalent x86/x64/C computations.
 
Turing equivalent computations derive equivalent output or fail to halt
on equivalent input between the concrete machine and its Turing machine
equivalent.
 
Some machines that (for example) count to infinity and store the counter
at each increment do not map to any finite computation.
 
 
--
Copyright 2020 Pete Olcott
olcott <NoOne@NoWhere.com>: Sep 05 11:41AM -0500

There is no possible way for any concrete implementation of "C" to be
made equivalent to a Turing machine. If we used every atom in the whole
universe to each store a single binary digit we would still be woefully
short of unlimited memory.
 
We can override and supersede the standard "C" and map its syntax and
semantics to an abstract model of computation that is Turing equivalent.
The RASP model of computation is a model that "C" can be mapped to.
https://en.wikipedia.org/wiki/Random-access_stored-program_machine
 
A variation of the RASP model is shown below that the x86/x64 language
maps to. Since it is already known that "C" maps to the x86/x64 concrete
models of computation we know that "C" maps to the following abstract model:
 
Instruction
: INTEGER ":" OPCODE // Address:Opcode
| INTEGER ":" OPCODE INTEGER // Address:Opcode Operand
| INTEGER ":" OPCODE INTEGER "," INTEGER // Address:Opcode
Operand, Operand
HEXDIGIT [a-fA-F0-9]
INTEGER {HEXDIGIT}+
OPCODE HEXDIGIT{4}
 
The above abstract machine maps the x86 language to machines with a
fixed pointer size of the largest unlimited integer address that is
actually needed by the computation. This provides the basis for
recognizing the set of Turing equivalent x86/x64/C computations.
 
Turing equivalent computations derive equivalent output or fail to halt
on equivalent input between the concrete machine and its Turing machine
equivalent.
 
Some machines that (for example) count to infinity and store the counter
at each increment do not map to any finite computation.
 
 
--
Copyright 2020 Pete Olcott
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: