Tuesday, July 31, 2018

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

woodbrian77@gmail.com: Jul 30 06:19PM -0700

On Monday, July 30, 2018 at 5:05:38 PM UTC-5, jacobnavia wrote:
> my email anywhere and give people more opportunities to send me spam, so
> I tried to close that, but it is impossible. The programmer didn't put a
> close button or something to get out of that window.
 
Clicking on the "back" button works.
 
 
> This one has PHP code completion, a feature the author is very proud of.
> Animations in the screen show you typing and code completion at work.
 
> This "IDE" is then actually a PHP editor with code completion.
 
I agree that vim is good enough for most things, but they
may be on to something.
 
[ snip ]
 
 
> I took the link because you cited King. That was disconcerting enough to
> be worth a click.
 
> But using M. L. King to sell a PHP editor?
 
Not using him to sell anything. I appreciate his faith
and his work to create a colorblind society.
 
 
Brian
Ebenezer Enterprises
https://github.com/Ebenezer-group/onwards
David Brown <david.brown@hesbynett.no>: Jul 31 09:43AM +0200


> "On-line code generators aren't a viable solution -
> who wants to be dependent upon a third-party that
> may disappear tomorrow?"
 
That is just one of a dozen reasons why they are mostly irrelevant (and
mostly disliked by people who have to use them).
 
> https://codetasty.com/
 
> And there are a number of reasons why the C++ Middleware
> Writer (an on-line code generator) is better than codetasty:
 
How can you be comparing your obscure and limited "apple" to their
obscure and limited "orange", and concluding that yours is "better"? As
far as I understand it, you have made a code generator. They have made
an IDE. The only thing they have in common is that you use a browser to
work it.
 
 
> 1. The C++ Middleware Writer is free.
> 2. You don't have to upload all or even most of your project.
 
> Some of the "experts" here don't like the way things are going:
 
None of the experts (or "experts" either) here are bothered in the
slightest, because this is /not/ the way anything is going. Blind,
manic optimism and repeated assertions is not going to make "online code
generation" into anything significant outside very niche areas.
 
When ARM brought out its "mbed" system, it was originally using an
online IDE and compilers on their servers. People thought it was a
great idea for spending a few hours playing around and testing out the
system without installing massive editors, compiler suites, libraries,
etc. But it was also immediately clear that no one would use it for
anything serious until they could do everything entirely on their own
machines - something that ARM quickly supported.
 
 
> in a nation where they will not be judged by the color of
> their skin but by the content of their character."
> Pastor Martin Luther King Jr.
 
How has this /anything/ to do with /your/ dream that online code
generation will take over the world - or at least that /someone/ will
make use of your online code generator? Your delusions of grandeur
apparently know no bounds.
 
 
> While these "experts" could get a way with it they tried to
> sway people from my work. They were successful for a while,
> but that's starting to crumble now.
 
At the risk of upsetting your delicate sensibilities, that is complete
bollocks.
jacobnavia <jacob@jacob.remcomp.fr>: Jul 31 01:14PM +0200


> [ snip ]
 
Yes, you snipped this:
 
<I wrote >
 
No setup?
 
How can I tell it to display tabs at 6 positions? I would like to know.
And please, not 4, not 8, but 6. OK?
<end quote>
 
Can you tell me then, how do I do that in your editor???
 
No setup you say. OK
 
Just tell me how do I do it.
 
Thanks
"Öö Tiib" <ootiib@hot.ee>: Jul 31 11:29AM -0700

> > popular format) for compatibility.
 
> I'm open to adding support for JSON, but haven't worked on
> that yet.
 
It was just an example of real need that is behind what people choose.
Not the opinion of "experts" whom you accuse but actual necessity.
 
> > * Bigger data (like video and sound) are too expensive to serialize
> > without compression.
 
> There's support for compression via code from quicklz.com.
 
It had compression rates like 3:1 or 2:1 for plain text. Video
streams are massive so usually less than 50:1 is insufficient.
 
> > * Potentially confidential information needs to be serialized with
> > encryption.
 
> I don't have support for this yet, but agree it's important.
 
Again it is just an example that can be actual necessity. Even for
rather mundane reason like for to reduce ways for some online
game host to cheat and so to spoil it for his playmates.
 
> > libraries. What needs your code generator fulfills? If not any of
> > those three then there must be something else.
 
> It automates the creation of serialization functions.
 
That might be indeed convenience that some need but also it is quite
tricky to automate. Data is rarely free of complications so it usually
takes some indication by developer to make the tools or libraries to
realize how and what of it to serialize.
Look at your list http://webebenezer.net/supportedTypes.html
It does only mention std::unique_ptr and boost::scoped_ptr. What
does it do with raw pointers? Some may need deep restoration of raw
pointers. Some may need proper restoration of pointers to non-owned
data. What it does or does not do is unclear and are you really
expecting people to figure it out by trying?
 
> the code generator is easier than installing multiple
> versions of a library/compiler. Compiler Explorer is
> an example of this.
 
Are you avoiding my question about actual needs and benefits with such
random claims? People use things like Compiler Explorer to try out or
to demonstrate to others some special case about particular compiler
on toy examples. That has nothing to do with your product.
 
> in that area, but sometimes they don't. Because we have
> an on-line tool, we have an easier time deciding what to
> work on next.
 
Huh? What need that resolves? The compiler vendors are again doing
something else entirely in other league. Major ones have
money, patents, development teams and knowledge of likes of Microsoft,
Oracle, Apple, Google, Intel, and so on at their disposal. Even if
they are wrong at rate 10:1 then they will still add hundred things
that no one needs plus 10 things that lot of people need while you
ponder if to add support to JSON or what.
 
The question was: what are the needs that your product deals with
most outstandingly? Anyone who tries to market something must be is most
happy about that question. If you haven't thought that thru then you
should start from there I guess and not from accusing "experts" here
in your small user base.
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jul 31 06:14PM +0100

Hi!
 
I'mma making an ECS!
 
That is all.
 
Message ends.
 
/Flibble
 
--
"Suppose it's all true, and you walk up to the pearly gates, and are
confronted by God," Bryne 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."
ram@zedat.fu-berlin.de (Stefan Ram): Jul 31 12:21PM

Some months ago I wrote:
 
>extend/improve/correct the parts given below?
>auto explain
>( bool DCu /* whether a default constructor is user-provided */,
 
. I asked about a C++ algorithm that exactly specifies when
certain constructors are defined implicitly.
 
It only now has come to my mind that some people inside and
outside the committee, especially Herb Sutter, are actually
working to make this happen! (It will not be in C++2a, but
it might come later.)
 
Turns out, they, too, do prefer algorithms to standardese,
and they call these algorithms (in this case) "metaclasses".
 
For more, watch the talk "Meta: Thoughts on generative C"
by Herb Sutter held at the cppcon 2017.
 
In the end, the source code of the default metaclass for
C++ classes should contain exactly the algorithm I asked for!
Thanks, Herb et al!
 
(I had to think of this, as I now watch the talk of Nicolai
Josuttis, who said that copy constructors are almost always
generated, unless one defines certain move operations. This
made me aware that I am still looking for a concise text
with a set of rules that tells me under which circumstances
certain constructors are not generated.)
ram@zedat.fu-berlin.de (Stefan Ram): Jul 31 04:39PM

>I am still looking for a concise text with a set of rules
>that tells me under which circumstances certain constructors
>are not generated.
 
Ok, found such a text in ...
 
*** SURPRISE! ***
 
Wikipedia (page about special member functions).
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jul 31 07:06AM +0200

On 30.07.2018 23:18, Stefan Ram wrote:
 
> So, is »decltype( a )::value_type« here the most elegant /
> natural / concise way to express that type or is there a
> better way?<
 
`auto` comes to mind.
 
As well as `decltype( +*a.begin() )`.
 
 
< (Since this is intended to show off »value_type«,
> »value_type« should appear in the answer. So, »auto v = ...«
> would not be helpful.)
 
An example where `value_type` is useful information could be some
interaction with some code that requires `value_type`. Yes I know that's
circular to some degree. But that's reality: much of this stuff is only
needed when using code that (needlessly?) depends on it.
 
Cheers!,
 
- Alf
Juha Nieminen <nospam@thanks.invalid>: Jul 31 06:08AM

> #include <iostream>
> #include <ostream>
 
Rather redundant, don't you think?
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jul 31 11:37AM +0200

On 31.07.2018 08:08, Juha Nieminen wrote:
>> #include <iostream>
>> #include <ostream>
 
> Rather redundant, don't you think?
 
With C++11 and later, yes.
 
With C++03 it was /formally/ required for the definition of << and for
std::endl, although ~all the examples in the standard that used text
output failed to include <ostream>.
 
Happily in ISO standards examples aren't normative, otherwise there
would have been a formal self-contradiction.
 
 
Cheers!,
 
- Alf
Manfred <noname@add.invalid>: Jul 31 12:30PM +0200

On 7/31/2018 7:06 AM, Alf P. Steinbach wrote:
> interaction with some code that requires `value_type`. Yes I know that's
> circular to some degree. But that's reality: much of this stuff is only
> needed when using code that (needlessly?) depends on it.
 
I'm not sure it is that needless - I would say it is not uncommon to
encounter value_type or similar type members when using template
libraries (the standard library being the first obvious example)
 
Another example is the boost library, recalling an older post where I
elaborated on a suggestion of yours:
 
> template< typename Range >
> bool is_even(const typename boost::range_value<Range>::type& x) { return x.index()%2 == 0; }
 
Here range_type, although with a different construct than value_type,
serves the same purpose: accessing a dependent type nested inside a
class template.
David Brown <david.brown@hesbynett.no>: Jul 31 08:04AM +0200

On 26/07/18 21:51, jacobnavia wrote:
 
> Gdb can also debug itself, but as a part of an IDE it is quite awfull
> really. The many commands that you have to remember... pages and pages
> of documentation...
 
I can't see your problem at all. I have used gdb with IDE's for a
couple of decades - no commands are needed. gdb has several interfaces,
including the command-line interface, the "MI" interface for front ends,
and (relatively recently) a python interface for automation, fancier
display of data, etc.
 
The command line interface to the debugger is great for certain tasks.
It lets you do common things quickly, and can be automated - I have used
it for scripting debugging or for programming and testing embedded
systems. But it is a bit tedious for general debugging use, unless you
use it enough to remember all the commands you need.
 
I have never used the MI interface directly - but I have used a number
of gdb front ends that use it. These days, that is usually Eclipse.
Debugging with gdb and Eclipse is not painless - but then, no debugging
is ever entirely painless, especially cross debugging, and there is
always a balance between efficient code and easily debugged code. A
huge advantage of the gdb system and its MI interface is that gdb and
the front end are separate - I can use one IDE with multiple gdb builds
for different target processors.
 
 
> It does some simple stuff, for instance if you start the name of an
> identifier it will fill it when you press tab, if there is one in the
> current scope that starts with those letters.
 
That is the command line interface - it is not something you use with an
IDE.
 
 
> A text mode application can't display much information though. Windows
> are much better for display info in a debugger.
 
Agreed (although the command line interface is occasionally handy).
That's why gdb has interfaces to graphical and windowed front ends.
 
> is 2+3; in other languages like C++
 
> Can elisp drive gdb?
 
> Gdb can be driven by the text commands interface. Apparently has no API.
 
Apparently it does - GDB/MI - and has had for a couple of decades or so.
It also has an extensive Python API, which is the modern way to handle
this. And it has a GNU Guile (Scheme) API. I haven't used these
myself, but then, I have not be involved in writing a debugger front end.
 
> You have to read the results of gdb by parsing text output...
 
The GDB/MI is a text interface (it is designed to work over a network
socket - I have had use of that, running the front end on a PC at home
and the gdb backend on a PC at the office). But it is designed to be
easy to parse.
 
Tim Rentsch <txr@alumni.caltech.edu>: Jul 31 01:19AM -0700


>>> Add into ~/.gnu-emacs-custom :
 
>>> '(tab-width 4)
 
>>> I have to admit I have little idea what these lines do,
 
You may be better off for that. :)
 
> somehow related behind the scenes and how, what is
> backward-delete-char-untabify-method and why it is here in my
> instructions, etc.
 
To find out you can ask emacs:
 
ESC x describe-function RET add-hook RET
 
add-hook is a compiled Lisp function in `subr.el'.
(add-hook HOOK FUNCTION &optional APPEND LOCAL)
 
Add to the value of HOOK the function FUNCTION.
FUNCTION is not added if already present.
FUNCTION is added (if necessary) at the beginning of the hook list
unless the optional argument APPEND is non-nil, in which case
FUNCTION is added at the end.
 
The optional fourth argument, LOCAL, if non-nil, says to modify
the hook's buffer-local value rather than its default value.
This makes the hook buffer-local if needed, and it makes t a member
of the buffer-local value. That acts as a flag to run the hook
functions in the default value as well as in the local value.
 
HOOK should be a symbol, and FUNCTION may be any valid function. If
HOOK is void, it is first set to nil. If HOOK's value is a single
function, it is changed to a list of functions.
 
ESC x describe-variable RET c++-mode-hook RET
 
c++-mode-hook is a variable defined in `cc-vars.el'.
Its value is nil
 
Documentation:
*Hook called by `c++-mode'.
 
You can customize this variable.
 
ESC x describe-variable RET backward-delete-char-untabify-method RET
 
backward-delete-char-untabify-method is a variable defined in `simple.el'.
Its value is untabify
 
Documentation:
*The method for untabifying when deleting backward.
Can be `untabify' -- turn a tab to many spaces, then delete one space;
`hungry' -- delete all whitespace, both tabs and spaces;
`all' -- delete all whitespace, including tabs, spaces and newlines;
nil -- just delete one character.
 
You can customize this variable.
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jul 31 08:43AM

On Mon, 2018-07-30, Paavo Helde wrote:
> '(lambda () (setq tab-width 4) (setq c-basic-offset 4)))
> (setq backward-delete-char-untabify-method nil)
> (add-to-list 'auto-mode-alist '("\\.h$" . c++-mode))
 
Yeah, that's the recipe you tend to find first when googling, for
some reason. I find the "bsd4 is like bsd, but with offset 4" construct
much more convenient, plus the style gets a name and you can switch
to it with "C-c ."
 
If I wanted to indent by 4 with 4-wide TABs[0], I'd do something like:
 
(c-add-style "paavo" '("bsd" (c-basic-offset . 4) (tab-width . 4)
(indent-tabs-mode . t)))
(setq c-default-style "paavo")
 
 
> '(tab-width 4)
 
> I have to admit I have little idea what these lines do, and why
> modifying two files is necessary.
 
I don't understand ~/.gnu-emacs-custom either. Something that gets created
if you try to customize via point and click, I suspect. I never
trusted that feature to do anything sensible, but perhaps I'm wrong.
 
/Jorgen
 
[0] Seems to be a common convention on Windows; it would be nice if
Emacs had it as a predefined style and called it "visualstudio"
or something.
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jul 31 09:30AM

On Tue, 2018-07-10, Bo Persson wrote:
> explains, and the nature of programming means that significant amounts
> of time get dedicated to "what is essentially busywork."
 
> without him fully realizing that.
 
I didn't understand "busywork". Wikipedia says "... activity that is
undertaken to pass time and stay busy but in and of itself has no
actual value". Doesn't seem right to me -- did he mean to use some
other word?
 
Because one dangerous aspect of such work is, IME, that you tend to
forget that it has no value.
 
> I have seen the "new system"-syndrome in real life:
 
Perhaps it doesn't need saying, but I think we all have, if we've been
in the business for a while.
 
[snip very illustrative story]
 
There's a saying (and a Kylie Minogue song) "better the devil you
know", but we don't seem to follow it.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Tim Rentsch <txr@alumni.caltech.edu>: Jul 31 01:05AM -0700

> to the C99 standard and MSVC++ doesn't even support C99 properly
> anyway. The de facto C standard is still C89 and probably always
> will be.
 
That used to be true but isn't any longer. In particular, gcc
in its default mode used to be based on C89/C90, but now is
based on C11.
boltar@cylonHQ.com: Jul 31 08:24AM

On Tue, 31 Jul 2018 01:05:54 -0700
 
>That used to be true but isn't any longer. In particular, gcc
>in its default mode used to be based on C89/C90, but now is
>based on C11.
 
Fair enough. I didn't even realise there was a C 2011 and looking at it the
updates seem fairly specialised and nothing that isn't already in C++ anyway
so I don't think I'll be looking into it much further. Useful to know though.
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Jul 31 01:40AM -0700


>> That used to be true but isn't any longer. In particular, gcc
>> in its default mode used to be based on C89/C90, but now is
>> based on C11.
 
Tell me when GCC fully supports C11 threading and atomics. So far, only
Pelles C does it. Well, it "kind of" supports the atomics:
 
https://forum.pellesc.de/index.php?topic=7311.0
 
https://forum.pellesc.de/index.php?topic=7167.0
 
damn.
 
 
gazelle@shell.xmission.com (Kenny McCormack): Jul 31 07:20AM

In article <5d9825cb-8cbc-4975-bc1c-8570fc9071ea@googlegroups.com>,
>> This post showing much we want Rick C hodgin to leave this group.
>> If you want him to leave. Leave you name in reply. thanks
 
>+1.
 
I can no more imagine CLC/C++ without the amusement generated by Rick, than
I can imagine either group without the amusement of Kiki (*).
 
(*) Yes, as far as I know, Kiki only posts in CLC (not C++), but the point
is still valid. FWIW, there doesn't seem to be any standard appointed
topicality cop in CLC++ like there is in CLC. Which is a shame...
 
--
Pensacola - the thinking man's drink.
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: