Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Native Aspect-oriented programming in C++

146 views
Skip to first unread message

Côme David

unread,
Dec 7, 2013, 3:45:51 PM12/7/13
to
Hello everyone.

I've been wondering why there have never been any proposal to a native
support for Aspect-oriented programming in the C++ core.

I think this tool would be a nice improvement and could be used for
instance to :
* ensure classes' invariant
* logging purpose
* etc ..

Does anyone has an explanation ?

Thank you !
David Come.

ralph

unread,
Dec 7, 2013, 5:15:28 PM12/7/13
to
On Sat, 07 Dec 2013 21:45:51 +0100, C�me David <davi...@gmail.com>
wrote:

>Hello everyone.
>
>I've been wondering why there have never been any proposal to a native
>support for Aspect-oriented programming in the C++ core.
>

What makes you think there haven't been any proposals?

I can't recall anything posted recently, nor anything directly
targeting C++'s 'core', but there are other groups and forums, and my
memory is poor.

>I think this tool would be a nice improvement and could be used for
>instance to :
>* ensure classes' invariant
>* logging purpose
>* etc ..
>

If you feel it would be such a nice improvement, then perhaps you
should present a nice proposal. I'm sure others would be interested -
especially when it comes to suggestions on how to enfold native
support within the core.

>Does anyone has an explanation ?
>

Perhaps they are shy?

Alf P. Steinbach

unread,
Dec 7, 2013, 5:16:31 PM12/7/13
to
On 07.12.2013 21:45, C�me David wrote:
>
> I've been wondering why there have never been any proposal to a native
> support for Aspect-oriented programming in the C++ core.

I think you mean "in the standard C++ library".

Otherwise what's "the C++ core"?

Re the standard, maybe, if you don't feel it's worthwhile for you
personally to do it, then others may have reasoned likewise?

Xerox ParcPlace (IIRC inventors of Aspect-oriented programming) may have
some implementations available. Microsoft once had an implementation for
COM-based classes. I think it's telling that I never found it worthwhile
to even test it. ;-)


> I think this tool would be a nice improvement and could be used for
> instance to :
> * ensure classes' invariant
> * logging purpose
> * etc ..

Yeah.


> Does anyone has an explanation ?

Not more than the above considerations.


Cheers & hth.,

- Alf

Alf P. Steinbach

unread,
Dec 7, 2013, 5:29:12 PM12/7/13
to
On 07.12.2013 23:16, Alf P. Steinbach wrote:
> On 07.12.2013 21:45, C�me David wrote:
>>
>> I've been wondering why there have never been any proposal to a native
>> support for Aspect-oriented programming in the C++ core.
>
> Microsoft once had an implementation for COM-based classes.

I think this was it, from 1999:

http://www.microsoft.com/msj/0199/intercept/intercept.aspx


Cheers,

- Alf

Paavo Helde

unread,
Dec 8, 2013, 4:21:20 AM12/8/13
to
C?me David <davi...@gmail.com> wrote in news:l801dv$ce$1
@talisker.lacave.net:

> Hello everyone.
>
> I've been wondering why there have never been any proposal to a native
> support for Aspect-oriented programming in the C++ core.

The Wikipedia article for aspect-oriented programming lists a couple of
aspect-oriented extensions to C++, like AspectC++ and FeatureC++. These
both work as preprocessors, converting the input language into real C++.

It appears in general the aspect-oriented programming requires injection
of code all over the place in unrelated code, probably breaking either
the separate compilation model or the zero-overhead principle of C++, not
to speak about introducing hidden control flow.

A bit of googling turns up some negative sentiment (see e.g.
http://developers.slashdot.org/story/05/04/24/0343224/aspect-oriented-
programming-considered-harmful):

"Aspect-oriented programming (AOP) is intended to address common problems
that object-oriented programming (OOP) doesn't address well, plus some
problems that OOP itself created. However, AOP is a risky solution: It is
a very generic mechanism for solving some very specific concerns and has
been likened to a kind of "GOTO" statement for OOP. Like GOTO, it can
cause more harm than good."

> I think this tool would be a nice improvement and could be used for
> instance to :
> * ensure classes' invariant
> * logging purpose
> * etc ..

The current take on such features in C++ is covered by the "private
virtual functions" idiom. In essence, this involves declaring virtual
functions private; there is a dedicated non-virtual public member
function in the base class which is calling the virtual function. This
single public member function can do the logging, checking invariants
before and after, etc. Probably a bit more tedious to set up than in
aspect-oriented languages, but does not break the class encapsulation
rules and is already working in current C++.

> Does anyone has an explanation ?

I would guess this is because it would encourage writing more fragile
code, plus there is already a working idiom (private virtuals) present
which can achieve similar things.

Cheers
Paavo


Côme David

unread,
Dec 9, 2013, 3:39:34 PM12/9/13
to
Le 07/12/2013 23:16, Alf P. Steinbach a �crit :
> On 07.12.2013 21:45, C�me David wrote:
>>
>> I've been wondering why there have never been any proposal to a native
>> support for Aspect-oriented programming in the C++ core.
>
> I think you mean "in the standard C++ library".
>
> Otherwise what's "the C++ core"?
>
By code I meant in the norm or in a TR.
Because there are some implementations but they use external
pre-processing tools.

> Re the standard, maybe, if you don't feel it's worthwhile for you
> personally to do it, then others may have reasoned likewise?
>

I feel it is worthwhile, and I want the other people's opinions on that
subject because it is not frequently discussed; It is just I'm not good
enough at all to send a proposal.

> It appears in general the aspect-oriented programming requires
>injection of code all over the place in unrelated code, probably
>breaking
>either the separate compilation model or the zero-overhead principle
>of C++, not to speak about introducing hidden control flow.

Like a tool, it could be misused, I think there will be some misuses of
C++11 auto. Does it mean we should not have put auto in C++11 ?

Moreover there is not such a difference between a predictive call to a
cutpoint and and call to a destructor at the end of a function.
(Yes, with the destructor you know it will be called just by looking at
the function's body, for an aspect you don't know if something will occur)

And we could imagine to put some restraint on what could be done in an
aspect or on what aspect could apply. For instance, an aspect
could be automatically const, allowed only to check some assert...



Alf P. Steinbach

unread,
Dec 9, 2013, 7:06:36 PM12/9/13
to
On 09.12.2013 21:39, C�me David wrote:
> Le 07/12/2013 23:16, Alf P. Steinbach a �crit :
>
> > It appears in general the aspect-oriented programming requires
> >injection of code all over the place in unrelated code, probably
> >breaking
> >either the separate compilation model or the zero-overhead principle
> >of C++, not to speak about introducing hidden control flow.
>
> Like a tool, it could be misused, I think there will be some misuses of
> C++11 auto. Does it mean we should not have put auto in C++11 ?

I didn't write what you attribute to me above.

Moreover I can't see it in any posting.

So if the quote is real but misattributed, then it must have been
written by someone in my killfile[1], i.e. written by a person who
regularly misrepresents, posts flamebait and such.


Cheers,

- Alf

Notes:
[1] Current killfile (not all of these are trolls:
(from,is,v.ba...@comcast.invalid)
(from,is,ge...@invalid.invalid)
(from,is,mymaila...@gmail.com)
(from,is,myfir...@osa.pri.ee)
(from,is,daniel...@gmail.com)
(from,is,s...@email-scan.com)
(from,is,david...@removethis.hesbynett.no)
(from,is,tom...@gmail.com)
(from,is,da...@westcontrol.removethisbit.com)
(from,contains,dombo)
(from,is,sc...@slp53.sl.home)
(from,is,tro...@bluewin.ch)
(from,is,le...@i42.co.uk)
(from,is,vlad....@mail.ru)
(from,contains,chris) AND (from,contains,vine)
(from,contains,vlad.moscow) AND (from,contains,)

CV

unread,
Dec 10, 2013, 9:27:08 AM12/10/13
to
On Tue, 10 Dec 2013 01:06:36 +0100
"Alf P. Steinbach" <alf.p.stein...@gmail.com> wrote:
[snip]
> So if the quote is real but misattributed, then it must have been
> written by someone in my killfile[1], i.e. written by a person who
> regularly misrepresents, posts flamebait and such.
>
>
> Cheers,
>
> - Alf
>
> Notes:
> [1] Current killfile (not all of these are trolls:
[snip]

Your repeated ad hominem attacks on people posting to this newsgroup are
unacceptable.

You may think this is a clever way of getting at some of the many people
you have fallen out with, but all it shows to people is that you have
the emotional maturity of a 6 or 7 year old. You just make yourself
out to be a complete asshole.

Why not stop it? Surely there is some one (a friend, or if you have
none, your mother) with whom you can discuss this.

Chris

Alf P. Steinbach

unread,
Dec 10, 2013, 12:49:23 PM12/10/13
to
On 10.12.2013 15:27, CV wrote:
[snip attack]
>
> Chris

[Chris Vine posting under yet another new e-mail address]

plink


none

unread,
Dec 10, 2013, 1:41:05 PM12/10/13
to
On Tue, 10 Dec 2013 18:49:23 +0100
"Alf P. Steinbach" <alf.p.stein...@gmail.com> wrote:
Of course I was, since you were good enough to post your killfile.

I was hoping to get you to moderate your unacceptable behaviour. Is
there any chance of that?

Chris

Mr Flibble

unread,
Dec 10, 2013, 1:51:24 PM12/10/13
to
Don't feed the troll. ;)

/Flibble

Mr Flobble

unread,
Dec 10, 2013, 1:59:11 PM12/10/13
to
I do not think he is a conventional troll. He seems to have
difficulties relating to other people, and cannot put himself in
others' shoes. I was hoping to encourage him to look a little more at
his behaviour, in the hope that it might improve. Him discussing it
with someone else seems the obvious way forward.

Flobble

Daniel

unread,
Dec 10, 2013, 3:04:21 PM12/10/13
to
On Tuesday, December 10, 2013 1:59:11 PM UTC-5, Mr Flobble wrote:
>
> I do not think he is a conventional troll.

Of course not. Alf is a valued member of this group, invariably trying to be helpful, and generous with his time.

And yet ... in my imagination I'm seeing a remake of The Shining. This time Jack has a computer project that is going nowhere, and Wendy's discovery is endless pages of "A plink a day keeps the plonker away" repeated ad infinitum.

Daniel


Chris Vine

unread,
Dec 10, 2013, 5:45:22 PM12/10/13
to
I think that is fair enough. And given that you are one of the plinked
(or was it plonked) ones described in the list above as amongst those
comprising "a person who regularly misrepresents, posts flamebait and
such", quite generous.

Alf has plus points, including a compendious knowledge of C++, and wide
experience of mainly microsoft compilers, yet minus points as well,
principally his struggle to tolerate anyone disgreeing with him, which
makes him quite tiresome to deal with and blind to the offence he
causes to other people.

Chris

Alf P. Steinbach

unread,
Dec 10, 2013, 10:32:23 PM12/10/13
to
On 10.12.2013 19:51, Mr Flibble wrote:
[snip attack]
>
> /Flibble

[Leigh Johnson posting with a different nick]

plink


Drew Lawson

unread,
Dec 10, 2013, 10:54:27 PM12/10/13
to
In article <c28601d4-b292-4381...@googlegroups.com>
Daniel <daniel...@gmail.com> writes:
>
>And yet ... in my imagination I'm seeing a remake of The Shining.
>This time Jack has a computer project that is going nowhere, and
>Wendy's discovery is endless pages of "A plink a day keeps the
>plonker away" repeated ad infinitum.

Likewise. I've been trending toward the conclusion that he has
contracted Leigh Johnson Disease. Once posting useful content and
now, rather than single word vulgar posts, auto posts of "you lie
and distort, plink."

I haven't filtered him yet, but it has been a while since I've seen
content other than advocating things that would give the Obfuscated
C Contest judges wet dreams.

I guess this is his street corner with a cardboard sign.
Whatever.

--
Drew Lawson | Savage bed foot-warmer
| of purest feline ancestry
| Look out little furry folk
| it's the all-night working cat

Alf P. Steinbach

unread,
Dec 10, 2013, 11:17:24 PM12/10/13
to
On 11.12.2013 04:54, Drew Lawson wrote:
[snip attack]

plink

Alf P. Steinbach

unread,
Dec 10, 2013, 11:30:25 PM12/10/13
to
Just for readers' information:

This newsgroup has been infested by trolls, people who deliberately
sabotage (like graffiti youngsters), for some years.

Up-thread some just slightly unreasonable text was incorrectly
attributed to me, inserted in the middle of or at the end at other text
that I had written, in a posting by Mr. C�me David, and all trolling
action has followed my response pointing out that I didn't write it.


- Alf

Trex

unread,
Dec 11, 2013, 5:35:20 AM12/11/13
to
On Wed, 11 Dec 2013 05:30:25 +0100
"Alf P. Steinbach" <alf.p.stein...@gmail.com> wrote:
> On 11.12.2013 05:17, Alf P. Steinbach wrote:
> > On 11.12.2013 04:54, Drew Lawson wrote:
> > [snip attack]
> >
> > plink
> >
>
> Just for readers' information:
>
> This newsgroup has been infested by trolls, people who deliberately
> sabotage (like graffiti youngsters), for some years.
>
> Up-thread some just slightly unreasonable text was incorrectly
> attributed to me, inserted in the middle of or at the end at other
> text that I had written, in a posting by Mr. Côme David, and all
> trolling action has followed my response pointing out that I didn't
> write it.

Alf, the problem is that your response did not just point out that you
didn't write it, which would have been fine. You used it as an excuse
to have a go at all those you have "plinked", reproducing your list and
describing people on it as "a person who regularly misrepresents, posts
flamebait and such". You have regularly done similar things in recent
weeks.

This was premeditated and unacceptable. I can see that you struggle to
tolerate other people disagreeing with you, but can you not master that
enough at least to improve that aspect of your behaviour?

Chris

Alf P. Steinbach

unread,
Dec 11, 2013, 6:07:03 AM12/11/13
to
On 11.12.2013 11:35, Trex alias Chris Vine wrote:
[snip attack]

plinking also this Chris Vine identity (I think it's the fourth)

- Alf

Alf P. Steinbach

unread,
Dec 11, 2013, 6:07:40 AM12/11/13
to
Just for readers' information:

This newsgroup has been infested by trolls, people who deliberately
sabotage (like graffiti youngsters), for some years.

Up-thread some just slightly unreasonable text was incorrectly
attributed to me, inserted in the middle of or at the end at other text
that I had written, in a posting by Mr. C�me David, and all trolling
action has followed my response pointing out that I didn't write it.


- Alf


Öö Tiib

unread,
Dec 11, 2013, 12:43:50 PM12/11/13
to
On Wednesday, 11 December 2013 12:35:20 UTC+2, Trex wrote:
> This was premeditated and unacceptable. I can see that you struggle to
> tolerate other people disagreeing with you, but can you not master that
> enough at least to improve that aspect of your behaviour?

So, there is a person in internet who does not want to communicate
with you. For whatever reasons. Rational or irrational. Fair or
unfair. We can discuss it but why? Even if all 7 billions of us
say that we see his opinions unjust then that does not anyway
make him to desire to communicate with you. So it is pointless
to discuss it.

Worse, you and Leigh making pile of alter egos just to bypass the
killfile of Alf sort of support his points.

Mr Flibble

unread,
Dec 11, 2013, 1:57:30 PM12/11/13
to
On 11/12/2013 03:54, Drew Lawson wrote:
> In article <c28601d4-b292-4381...@googlegroups.com>
> Daniel <daniel...@gmail.com> writes:
>>
>> And yet ... in my imagination I'm seeing a remake of The Shining.
>> This time Jack has a computer project that is going nowhere, and
>> Wendy's discovery is endless pages of "A plink a day keeps the
>> plonker away" repeated ad infinitum.
>
> Likewise. I've been trending toward the conclusion that he has
> contracted Leigh Johnson Disease. Once posting useful content and
> now, rather than single word vulgar posts, auto posts of "you lie
> and distort, plink."

I am diseased? Perhaps I no longer post much useful content as I am fed
up with perfectly fine posts being the target of trolls talking shite or
bigoted individuals spreading hate.

Sausages.

/Flibble


Chris Vine

unread,
Dec 11, 2013, 2:20:44 PM12/11/13
to
You are missing the point. I have no problem at all with Alf not
wanting to communicate with me, or anyone else. I cannot see on a fair
reading of the postings how you could conclude that I did.

What I have a problem with is the objectionable ad hominem remarks this
individual makes, which was the explicit purpose of him posting his
killfiles with associated remarks about those on it. Do you think that
is acceptable? He could and should have just said "You have
mis-attributed your quote".

I do not think you need to encourage this person.

Chris

Öö Tiib

unread,
Dec 11, 2013, 3:09:23 PM12/11/13
to
On Wednesday, 11 December 2013 21:20:44 UTC+2, Chris Vine wrote:
> On Wed, 11 Dec 2013 09:43:50 -0800 (PST)
> Öö Tiib <oot...@hot.ee> wrote:
> > So, there is a person in internet who does not want to communicate
> > with you. For whatever reasons. Rational or irrational. Fair or
> > unfair. We can discuss it but why? Even if all 7 billions of us
> > say that we see his opinions unjust then that does not anyway
> > make him to desire to communicate with you. So it is pointless
> > to discuss it.
> >
> > Worse, you and Leigh making pile of alter egos just to bypass the
> > killfile of Alf sort of support his points.
>
> You are missing the point. I have no problem at all with Alf not
> wanting to communicate with me, or anyone else. I cannot see on a fair
> reading of the postings how you could conclude that I did.

I concluded that from comedy with alter egos you did. Why if not for
communicating with him against his will? Isn't deliberately annoying
someone a flamebait? Didn't you do it regularly enough?

> What I have a problem with is the objectionable ad hominem remarks this
> individual makes, which was the explicit purpose of him posting his
> killfiles with associated remarks about those on it. Do you think that
> is acceptable? He could and should have just said "You have
> mis-attributed your quote".

I see no problem there either. It is freedom of speech. Everyone may
express their opinion. To say that it is libel you have to prove that
the couple subtle jargon terms he wrote are false *and* that it somehow
damaged your reputation.

> I do not think you need to encourage this person.

I have always felt all that game with killfiles childish. I tried to
discourage you from proving his points.

Chris Vine

unread,
Dec 11, 2013, 3:51:26 PM12/11/13
to
On Wed, 11 Dec 2013 12:09:23 -0800 (PST)
Öö Tiib <oot...@hot.ee> wrote:
[snip]
> > You are missing the point. I have no problem at all with Alf not
> > wanting to communicate with me, or anyone else. I cannot see on a
> > fair reading of the postings how you could conclude that I did.
>
> I concluded that from comedy with alter egos you did.

You concluded wrongly. I think a fair reading would indicate that it
was for the purpose of getting him to stop.

> Why if not for
> communicating with him against his will? Isn't deliberately annoying
> someone a flamebait? Didn't you do it regularly enough?

Sorry, if he thinks he can make remarks about some 10 or more people
(including me) by the device of replying to someone misattributing a
quote, then those concerned should be able to respond, and he should
hear the response. This is the third time he has done it in as many
weeks.

> > What I have a problem with is the objectionable ad hominem remarks
> > this individual makes, which was the explicit purpose of him
> > posting his killfiles with associated remarks about those on it.
> > Do you think that is acceptable? He could and should have just
> > said "You have mis-attributed your quote".
>
> I see no problem there either. It is freedom of speech. Everyone may
> express their opinion. To say that it is libel you have to prove that
> the couple subtle jargon terms he wrote are false *and* that it
> somehow damaged your reputation.

I didn't say it was libel[1], nor am I proposing to bring legal
proceedings against Alf. I simply said it was unacceptable and ad
hominem, which given the level or repetition I believe it to be. I
accept you are entitled to your view that this is within the realms of
freedom of speech; I happen not to agree, but I understand your point.
Of course if Alf were to be within the reasonable reach of freedom of
speech, unquestionably so was my response.

> > I do not think you need to encourage this person.
>
> I have always felt all that game with killfiles childish. I tried to
> discourage you from proving his points.

I don't think there is any danger that I was proving his point. I
think there is a danger you will encourage him. He does appear to
listen to you.

Chris


[1] Under the laws of England and Wales it would be, as it is clearly
defamatory and in writing. In the US it may or may not (the
requirement for malice imported by the first amendment technically only
applies to matters of public concern). I have no idea about Estonia,
but I am happy to take your word for it. More to the point, I have no
idea about Norway, which is where to have any meaningful effect I would
have to bring proceedings.

David Brown

unread,
Dec 11, 2013, 5:34:41 PM12/11/13
to
(Note - I have changed my posting identity. This is not to force Alf to
read this post, or to avoid killfiles. My ISP cut their news service a
few days ago, and I had to change to a different news server - it's a
complete coincidence.)


Whether the actions of Alf (or anyone else here) is libel or not
depends, I think, on whether comments really harm anyone's reputation.
In Norway, we don't go in for trivial lawsuits - I think Alf is entirely
safe from any legal action, and I doubt if any judge or jury will
consider that reputations to be seriously harmed.

For my own part, I am not worried about my reputation, or that anyone
else will pay much attention to Alf's killfile. And it is his choice to
decide which posts he reads, and which he ignores. But it certainly is
not pleasant to see one's name in a list of so-called trolls.

And of course it makes things difficult in threads in which both Alf and
I (or other "trolls") are involved. (As Chris said earlier, there are
no doubts about Alf's C++ experience, knowledge and willingness to help
and advise, so his contributions to threads are valued.)

mvh.,
David

Dombo

unread,
Dec 14, 2013, 6:48:24 AM12/14/13
to
On 11-Dec-13 23:34, David Brown wrote:
> Whether the actions of Alf (or anyone else here) is libel or not
> depends, I think, on whether comments really harm anyone's reputation.
> In Norway, we don't go in for trivial lawsuits - I think Alf is entirely
> safe from any legal action, and I doubt if any judge or jury will
> consider that reputations to be seriously harmed.

The only reputation Alf is harming is his own*. Imagine a potential
employer googling his name. No doubt the postings he made here will turn
up. What kind of impression will his postings leave of him?

> For my own part, I am not worried about my reputation, or that anyone
> else will pay much attention to Alf's killfile. And it is his choice to
> decide which posts he reads, and which he ignores. But it certainly is
> not pleasant to see one's name in a list of so-called trolls.

If it is any consolation; if someone has openly fallen out with so many
people (most of which are valued contributors) and feels the need to
publish that repeatedly, it is quite clear that the problem is not with
those people.

> And of course it makes things difficult in threads in which both Alf and
> I (or other "trolls") are involved. (As Chris said earlier, there are
> no doubts about Alf's C++ experience, knowledge and willingness to help
> and advise, so his contributions to threads are valued.)

Alf is also sometimes wrong (just like me, you and everyone else). One
of the benefits of a medium like usenet is that one can be corrected by
others to the benefit of us all. Alf's extremely strong tendency to
resort to personal attacks rather than engaging in a civilized
discussion stands in the way of this, and that is IMHO detrimental to
this group.

*I'm assuming here he is posting using his own name, rather than someone
else using his name to destroy his reputation.
0 new messages