March 30, 2007
Walter Bright wrote:
> kris wrote:
>>    Cout.opCall("Hello, ").opCall(Cin.get);
> 
> Given:
>     a.f(b,c);
> can be equivalently written as:
>     f(a,b,c);
> 
> we can transform:
>     Cout.opCall("Hello, ").opCall(Cin.get);
> into:
>     opCall(opCall(Cout,"Hello, "), Cin.get);
> 
> And it is transformed that way, because the optimizer/back end knows nothing about member functions. They're just more function calls.

Right.  Out of curiosity, does the ">>" operator have higher precedence than the "<<" operator in C++?  I know I've seen examples there where the operators were mixed on one line, and it seems like they should otherwise work just like the above.

> It's possible that in the future, to ensure source code portability of D, that the order of evaluation will become fixed. Such a change is a fair amount of work to accomplish, and will incur a runtime penalty (the implementation defined order allows the compiler to rearrange things to minimize register pressure). Even if the order was fixed, it still might not be in the right order for call chaining to work as your design needs it to.

I'm still undecided whether this would be a good thing.  It's more predictable, certainly, but it isn't clear whether that predictability is worth the loss of efficiency.  I don't suppose the compiler could somehow detect situations where such dependencies exist and only prevent optimizations for those?

> I also suggest that, with the maturing of the variadic template capability of D, using it will side step the order of evaluation problem completely. It'll still be an aesthetically pleasing design to the user.

Certainly.  About the only thing we'll need to resolve is that Stdout( "a", "b" ) currently prints "a, b" (ie. the default formatter output is comma delimited), and the lack of consistency here would be confusing.


Sean
March 30, 2007
James Dennett wrote:
> kris wrote:
[snip]
>>There's a good reason why "mystery" is in the topic line ;)
> 
> 
> What is that?  (Seriously.)

The example was known to be a tricky one, and the reaction to it was "strong"; it was being leveraged to hoist straw-men and at one point became "troll fodder" (for want of a better term).

Then there was a vague concern that Walter might be dropping support for call-chaining; thankfully that turned out to be incorrect.

My bewiliderment over that led the word "mystery" within the subject


>>I do hope that helps?
> 
> 
> It does, thank you.  

you are welcome
March 30, 2007
Sean Kelly wrote:
> Walter Bright wrote:
> 
>> kris wrote:
>>
>>>    Cout.opCall("Hello, ").opCall(Cin.get);
>>
>>
>> Given:
>>     a.f(b,c);
>> can be equivalently written as:
>>     f(a,b,c);
>>
>> we can transform:
>>     Cout.opCall("Hello, ").opCall(Cin.get);
>> into:
>>     opCall(opCall(Cout,"Hello, "), Cin.get);
>>
>> And it is transformed that way, because the optimizer/back end knows nothing about member functions. They're just more function calls.
> 
> 
> Right.  Out of curiosity, does the ">>" operator have higher precedence than the "<<" operator in C++?  I know I've seen examples there where the operators were mixed on one line, and it seems like they should otherwise work just like the above.
> 
>> It's possible that in the future, to ensure source code portability of D, that the order of evaluation will become fixed. Such a change is a fair amount of work to accomplish, and will incur a runtime penalty (the implementation defined order allows the compiler to rearrange things to minimize register pressure). Even if the order was fixed, it still might not be in the right order for call chaining to work as your design needs it to.
> 
> 
> I'm still undecided whether this would be a good thing.  It's more predictable, certainly, but it isn't clear whether that predictability is worth the loss of efficiency.  I don't suppose the compiler could somehow detect situations where such dependencies exist and only prevent optimizations for those?

FWIW: I don't believe that it is necessary to cement order of eval for arguments in the general case. There are undoubtedly good reasons for the variety of "call protocols" (argument passing), and fixing the order of eval would certainly have an effect upon their efficiency. As long as call-chaining is supported in the intuitive manner that it currently is, I would say the rest of the concerns are probably "implementation dependent"

2c

> 
>> I also suggest that, with the maturing of the variadic template capability of D, using it will side step the order of evaluation problem completely. It'll still be an aesthetically pleasing design to the user.
> 
> 
> Certainly.  About the only thing we'll need to resolve is that Stdout( "a", "b" ) currently prints "a, b" (ie. the default formatter output is comma delimited), and the lack of consistency here would be confusing.
> 
> 
> Sean
March 30, 2007
Sean Kelly wrote:
> Out of curiosity, does the ">>" operator have higher precedence than the "<<" operator in C++?

No, they are the same.
March 30, 2007
Andrei Alexandrescu (See Website For Email) wrote:
> John Reimer wrote:
[snip]

>> Andrei does come across as having an agenda.  I can accept that given his
>> position in the influence of D; but it's becoming very hard to separate
>> truth from perspective in all these posts.  Why is it wrong to state that
>> Andrei has an agenda?  He does, doesn't he?  Are we all afraid to admit it?
>> I just don't think he's going about it very honestly. If he were trully
>> seeking to be helpful to Tango design ideas, he would be contributing over
>> in the Tango forums... Since he doesn't do that, it's quite easy to see
>> why one might think he has an agenda... and not in Tango's favour.
>>
>> Andrei does tend to push his preferences on the community. That
>> deserves to be balanced.  Kris, Sean, and others have been doing their best
>> to be clear and fair in regards to addressing Tango "propaganda"; if
>> Andrei makes allegations about Tango, they are obligated to
>> either defend design decisions or accept recommendations as feasible and
>> beneficial.  I think they've been doing a very good job of both given the
>> circumstances.  Are people not noticing this?
>> I don't recall ever seeing Andrei admit he is wrong without some
>> equivication or deflection. If he does, it's often hidden in some sorty
>> joke or distraction. He's just not a straight forward person, plain and
>> simple.  Either that or he has trouble with humility.
>>
>> He's got oodles of creativity, good ideas, experience... and personal
>> opinions (like many here) and maybe even a little bit of academic rigour to
>> back him up :). He makes tons of :O) faces. But these matter little, if he
>> serves his own preferences, his own interests, and his own agenda.  Maybe
>> I got him wrong, but from what I've seen, I doubt it.
> 
> 
> The only civilized response I can imagine to this is killfiling sender's address. It's understandable for anyone to get heated and make a few ad hominem arguments in the midst of a heated argument. But to actually sit down and build an entire web of assumptions leading to sweeping personality judgments, that's just shady. 

This "shady" claim is surely an outrageous manipulation coming from someone who has recently exhibited the attributes of a troll?

JJR is one of the finest and fairest people who hang around here; he's known to be a humble and caring individual, with a certain distaste for confrontation.

For him to write what he did indicates a level of discontent beyond the pale, and it seems evident that this "web of assumptions" you lay at his feet is something instigated and shaped by your own hand.



> Put yourself for a minute at the receiving end of such calumny and you'll understand why you ought to be ashamed of yourself.

Then please consider your own behaviour, and the "receiving end" of those upon whom you have poured scorn? From the time you had a go at Tom through to this point, it is my opinion that you have at various times exhibited the attributes of a bigot, a bully, a megalomaniac and a troll. There will be others who share this view, and those who don't: the only thing that matters right here, given the history, is your audacity to "play to the gallery" as some /injured/ party.

If there's anyone who should be ashamed, it is yourself Andrei. You've been wholly effective at frittering away the wealth of respect you had commanded (from me at least), through the kind of behaviour that John described and Roberto *nailed* with his comment about your "trolling".

I'm no angel, yet I'll willingly shoulder responsibility for my actions and retract or apologize sincerely where I've made a mistake. On the other hand, I've yet to see a case (as John noted) where you've shown any remorse or real corrective action for anything questionable you've been party to. In truth, I've seen you ardently follow a course in the opposite direction. You are welcome to do that, of course, but don't start playing the injured & innocent and expect to walk away in a ray of sunshine.


[yes, I'll likely be hauled over the coals on this post too; yet sometimes it is better to first get the moose onto the table, and go from there]
March 31, 2007
kris wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> John Reimer wrote:
> [snip]
> 
>>> Andrei does come across as having an agenda.  I can accept that given his
>>> position in the influence of D; but it's becoming very hard to separate
>>> truth from perspective in all these posts.  Why is it wrong to state that
>>> Andrei has an agenda?  He does, doesn't he?  Are we all afraid to admit it?
>>> I just don't think he's going about it very honestly. If he were trully
>>> seeking to be helpful to Tango design ideas, he would be contributing over
>>> in the Tango forums... Since he doesn't do that, it's quite easy to see
>>> why one might think he has an agenda... and not in Tango's favour.
>>>
>>> Andrei does tend to push his preferences on the community. That
>>> deserves to be balanced.  Kris, Sean, and others have been doing their best
>>> to be clear and fair in regards to addressing Tango "propaganda"; if
>>> Andrei makes allegations about Tango, they are obligated to
>>> either defend design decisions or accept recommendations as feasible and
>>> beneficial.  I think they've been doing a very good job of both given the
>>> circumstances.  Are people not noticing this?
>>> I don't recall ever seeing Andrei admit he is wrong without some
>>> equivication or deflection. If he does, it's often hidden in some sorty
>>> joke or distraction. He's just not a straight forward person, plain and
>>> simple.  Either that or he has trouble with humility.
>>>
>>> He's got oodles of creativity, good ideas, experience... and personal
>>> opinions (like many here) and maybe even a little bit of academic rigour to
>>> back him up :). He makes tons of :O) faces. But these matter little, if he
>>> serves his own preferences, his own interests, and his own agenda.  Maybe
>>> I got him wrong, but from what I've seen, I doubt it.
>>
>>
>> The only civilized response I can imagine to this is killfiling sender's address. It's understandable for anyone to get heated and make a few ad hominem arguments in the midst of a heated argument. But to actually sit down and build an entire web of assumptions leading to sweeping personality judgments, that's just shady. 
> 
> This "shady" claim is surely an outrageous manipulation coming from someone who has recently exhibited the attributes of a troll?
> 
> JJR is one of the finest and fairest people who hang around here; he's known to be a humble and caring individual, with a certain distaste for confrontation.
> 
> For him to write what he did indicates a level of discontent beyond the pale, and it seems evident that this "web of assumptions" you lay at his feet is something instigated and shaped by your own hand.
> 
> 
> 
>> Put yourself for a minute at the receiving end of such calumny and you'll understand why you ought to be ashamed of yourself.
> 
> Then please consider your own behaviour, and the "receiving end" of those upon whom you have poured scorn? From the time you had a go at Tom through to this point, it is my opinion that you have at various times exhibited the attributes of a bigot, a bully, a megalomaniac and a troll. There will be others who share this view, and those who don't: the only thing that matters right here, given the history, is your audacity to "play to the gallery" as some /injured/ party.
> 
> If there's anyone who should be ashamed, it is yourself Andrei. You've been wholly effective at frittering away the wealth of respect you had commanded (from me at least), through the kind of behaviour that John described and Roberto *nailed* with his comment about your "trolling".
> 
> I'm no angel, yet I'll willingly shoulder responsibility for my actions and retract or apologize sincerely where I've made a mistake. On the other hand, I've yet to see a case (as John noted) where you've shown any remorse or real corrective action for anything questionable you've been party to. In truth, I've seen you ardently follow a course in the opposite direction. You are welcome to do that, of course, but don't start playing the injured & innocent and expect to walk away in a ray of sunshine.
> 
> 
> [yes, I'll likely be hauled over the coals on this post too; yet sometimes it is better to first get the moose onto the table, and go from there]

Ehm. It's much simpler than that. The problem with calumny, as opposed to a technical argument, is that there is little meaningful defense one can put forth, particularly in a newsgroup setting. That's why in any newsgroup debate sticking to the technical argument is important, while attacking the person is just an unprofessional cheap shot. The suggested exercise of putting oneself on the receiving position of a personal attack was meant to reveal exactly this issue (not posing as a victim etc.).

However contradictory a technical argument might get, it just works to follow this simple policy - stick to the technical points being made by others, and put forth technical points as well. Progress can be made and everybody can leave the discussion enriched. This has made my and others' participation to moderated newsgroup enjoyable and productive - indeed, I can't imagine myself programming in C++ or in general without the newsgroups comp.lang.c++.moderated or comp.std.c++. It looks, however, that on an unmoderated newsgroup technical ability is second to the willingness of using potshots and personal attacks in winning an argument.

You've said heavy words that were uncalled for, and I hope with time you'll acquire the decency to wish you hadn't. I won't be part of this bashing contest though; it's just silly and doesn't bring any good to anybody, so I'll sign off.


Andrei
--
Canis latrent, sed transigo acies.
March 31, 2007
Kris wrote:

> Bingo! It blows me away just how much attention the lowly console is recieving :)

It should.

Before C++ introduced cin and cout, most console I/O was [by the average programmer] written with routines specifically reading from the keyboard and writing to the screen, in DOS and Windows. Even for "line oriented programs".

In Unix, the I/O has always been a more general concept (we all know, but I'm writing this for others to read too), and I/O redirecting is more the rule than the exception with non-GUI apps.

Therefore, text-in-text-out programs should always use the standard handles. Only when very specific circumstances exist, one may do "direct 'console I/O' or the like". As a matter of fact, I don't remember any such apps or situations off-hand, although they certainly may exist.

We need this compatibility with "the Unix way" for two reasons: most programmers have to write D for both platforms (and actually "the Unix way" should be called "the non-Windows way").

The second (and admittedly more controversial) being, IMHO Vista is the last Windows version to come out of Redmond. The next will be based on *nix, one way or another. Just like Apple did. (Please everybody, counterarguments to this should be in some new thread, not in this one.)


This is not merely a convenience in Unix, it is _the_ fundamental concept of the operating system. Everything is text files, and every [non-GUI] program's I/O is redirectable.

Adherence to this has brought us with vastly simpler debugging, protocols, and utility of existing programs in ways not envisioned by the original programmer. And this is the precise reason why one can, using only Telnet (a trivial terminal emulator), directly interact with a mail server, or get web pages, even when one's computer does no graphics.


As an example, my first stab at the plastics processing software was a quick-and-dirty version that showed the temperatures and settings on the console. I did some cursor addressing and coloring of the output, but as I was on Linux, it all was to stdout.

The output was only almost what I wanted, so I ran the program simply redirecting its output to a file

  myprog > myfile

Looking at the file I could see the individual terminal escapes and immediately found my cursor addressing bug.

Later I wanted to see a lot of live data for temperature algorithm debugging and signal to noise ratio data. So I created some text output which I sent to stderr. Then I invoked the program like

  myprog 2>/dev/tty7

and I could follow the debug output in real time, without messing up the normal display.

Later it turned out I wanted historical data, so I invoked the program as

  myprog 2> mylog

and when it turned out that the new machine operator was computer illiterate, I wrote a startup script

  #!/bin/bash
  myprog 2>> mylog

...I could go on and on, but the idea is clear here: if I had originally written the program to read the keyboard directly and write to the screen buffer, I would have had a lot of work to do to accomplish this all.

Incidentally, now I have both logging and a real time display just by at any time opening a second session and writing

  tail -f mylog

----

To recap, the proper default way to do I/O is to use the pre-existing filehandles for all non-binary data. Tango should have the routines and documentation such that it steer the programmer to do just that.
March 31, 2007
Ow man, another newsgroup gone awry. And just after I've seen Dr. Zimbardo on the Daily Show and read his article at
http://chronicle.com/temp/email2.php?id=jwbxNygnt4HdpKkRmXbvrhmTJPqRVmJ3

What's up with people!? Are we so desperate to categorize eachother, so we can use some 'predefined' reactions?

I got depressed after reading that article, and more so after reading your post, Kris. Sorry.

People, just expect every comment is meant to be taken in the best way possible (even if that wasn't the intention). Because if you don't, there's no end to the misunderstandings.

L.
March 31, 2007
Andrei Alexandrescu (See Website For Email) wrote:
> 
> Ehm. It's much simpler than that. The problem with calumny, as opposed to a technical argument, is that there is little meaningful defense one can put forth, particularly in a newsgroup setting. That's why in any newsgroup debate sticking to the technical argument is important, while attacking the person is just an unprofessional cheap shot. The suggested exercise of putting oneself on the receiving position of a personal attack was meant to reveal exactly this issue (not posing as a victim etc.).
> 
> However contradictory a technical argument might get, it just works to follow this simple policy - stick to the technical points being made by others, and put forth technical points as well. Progress can be made and everybody can leave the discussion enriched. This has made my and others' participation to moderated newsgroup enjoyable and productive - indeed, I can't imagine myself programming in C++ or in general without the newsgroups comp.lang.c++.moderated or comp.std.c++. It looks, however, that on an unmoderated newsgroup technical ability is second to the willingness of using potshots and personal attacks in winning an argument.

My wife pointed something out to me yesterday regarding all this that seems worth mentioning here.  In a work environment, it is generally a bad idea to let grievances fester because doing so can sabotage productivity and lead to divisions in the group.  Instead, they are typically aired in a calm and rational manner and then the team hopefully moves on unencumbered by such feelings.

As you have said however, online discussions tend to do the opposite. The lack of visual cues for determining intent tends to foster misunderstandings, and physical separation gives rise to personal attacks that are left unaddressed in the interest of the conversation at hand.

I suppose the difference between the two situations is that in the former, a team of employees must work together closely, while online, people can simply choose not to interact with one another, or to do so in a limited manner.  Over time, I have noticed that these D newsgroups tend to behave somewhat more like a work environment than they do a typical online forum.  The number of active participants is a fairly small and regular group, and many know one another fairly well all things considered.

So both approaches for resolving conflict are de rigueur in different contexts, and given the type of community which seems to have developed here, I think both are to be expected based on the various participants' backgrounds, personal tastes, and perhaps their feeling of closeness to the community.  In particular, I would expect more of a work-oriented response from members of the Tango team (of which both John and Kris are a part), largely because it is essentially a development team that by necessity works together in an online context, within the larger context of the D community as a whole.

I do not think there is any need to comment on any of what was said directly, but I do think it would be a mistake to believe that either party feels they are acting in any but a constructive manner.  In fact, I think recent events suggest that some of the more vocal participants have accepted you as a member of this community, in their own way.  If not, there would be no reason to "clear the air" in such a manner, even if what was said may have been hurtful.


Sean
April 01, 2007
David B. Held wrote:
> 
> Now, allow me to say a thing or two.  I always thought it interesting that Andrei was able to toss Latin phrases into his CUJ columns myself.  I assumed he had a phrasebook handy or just took Latin in school or something; but the answer is much more mundane than that.  I hope he will not be too upset for spoiling his "secret", but the fact of the matter is that Romanian is almost indistinguishably close to Latin, which is to say, for all intents and purposes, Latin is Andrei's first language.

Yup.  As a point of interest for those who don't know (and to drift wildly off-topic), Romanian is one of the romance languages, all of which derive from Latin by definition.  I am sure that Andrei could recant a great deal more about Romanian history than I can, but the little I know is quite interesting.  It's well worth looking into for anyone interested in the propagation of language, culture, etc.


Sean