February 10, 2007
kris wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>>>> I think there is a lot of apprehension and misunderstanding surrounding what metacode is able and supposed to do or simplify. Please, let's focus on understanding _before_ forming an opinion.
>>>
>>>
>>> If that's the case, then perhaps it's due to a lack of solid & practical examples for people to examine? There's been at least two requests recently for an example of how this could help DeRailed in a truly practical sense, yet both of those requests appear to have been ignored thus far.
>>>
>>> I suspect that such practical examples would help everyone understand since, as you suggest, there appears to be "differences" in perspective? Since Walter brough RoR up, and you apparently endorsed his point, perhaps one of you might enlighten us via those relevant examples?
>>>
>>> There's a request in the original post on "The DeRailed Challenge" for just such an example ... don't feel overtly obliged; but it might do something to offset the misunderstanding you believe is prevalent.
>>
>>
>> I saw the request. My problem is that I don't know much about DeRailed, and that I don't have time to invest in it. 
> 
> You wrote (in the past):
> ====
> I think things would be better if we had better libraries and some success stories.
> ====
> 
> We have better libraries now. And we're /trying/ to build a particular success story. Is that not enough reason to illustrate some practical examples, busy though you are? I mean, /we're/ putting in a lot of effort, regardless of how busy our personal lives may be. All we're asking for are some practical and relevant examples as to why advanced DSL support in D will assist us so much.
> 
> 
>> My current understanding is that DeRailed's approach is basically dynamic, a domain that metaprogramming can help somewhat, but not a lot. The simplest example is to define variant types (probably they are already there) using templates. Also possibly there are some code generation aspects (e.g. for various platforms), which I understand RoR does a lot, that could be solved using metacode.
> 
> I read "Possibly there ... Could be solved ..."
> 
> Forgive me, Andrei, but that really does not assist in comprehending what it is that you say we fail to understand. Surely you would agree? Variant types can easily be handled by templates today, but without an example it's hard to tell if that's what you were referring to.
> 
> On Feb 7th, you wrote (in reference to the DSL discourse):
> =====
> Walter gave another good case study: Ruby on Rails. The success of Ruby
> on Rails has a lot to do with its ability to express abstractions that
> were a complete mess to deal with in concreteland.
> ====
> 
> On Feb 7th, Walter wrote (emphasis added):
> =====
> Good question. The simple answer is look what Ruby on Rails did for Ruby. Ruby's a good language, but the killer app for it was RoR. RoR is what drove adoption of Ruby through the roof. /Enabling ways for sophisticated DSLs to interoperate with D will enable such applications/
> =====
> 
> You see that subtle but important reference to RoR and DSL in the above? What we're asking for is that one of you explain just exactly what is /meant/ by that. DeRailed faces many of the same issues RoR did, so some relevant examples pertaining to the RoR claim may well assist DeRailed.
> 
> Do we have to get down on our knees and beg?

Aw, give me a break.

Andrei
February 10, 2007
Bill Baxter wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> This is a misunderstanding. The syntax is not to be extended. It stays fixed, and that is arguably a good thing. The semantics become more flexible. For example, they will make it easy to write a matrix operation:
>>
>> A = (I - B) * C + D
>>
>> and generate highly performant code from it. (There are many reasons for which that's way harder than it looks.)
> 
> This is one thing I haven't really understood in the discussion.  How do the current proposals help that case?  From what I'm getting you're going to have to write every statement like the above as something like:
> 
> mixin {
>    ProcessMatrixExpr!( "A = (I - B) * C + D;" );
> }
> 
> How do you get from this mixin/string processing stuff to an API that I might actually be willing to use for common operations?

That's a great starting point for a good conversation. And no, you
wouldn't do it with strings, you'd do it exactly as I wrote, with
regular code. You could use strings if you want to use more math-looking
operators and Greek symbols etc.

>> I think there is a lot of apprehension and misunderstanding surrounding what metacode is able and supposed to do or simplify. Please, let's focus on understanding _before_ forming an opinion.
> 
> I think that's exactly what Tom's getting at.  He's asking for examples of how this would make like better for him and others.  I think given your background you take it for granted that metaprogramming is the future.  But D is attracts folks from all kinds of walks of life, because it promises to be a kinder, gentler C++.  So some people here aren't even sure why D needs templates at all.  Fortran doesn't have 'em after all.  And Java just barely does.

Then such people would be hard-pressed to figure why tuples (which are
essentially typelists, the single most used component in Loki) have
engendered, according to Walter himself, a surge in language popularity.

I don't even think metaprogramming is the future. I think that it's one
of many helpful tools for writing good libraries, as are GC, modules, or
interfaces. *Everybody* appreciates good libraries.

> Anyway, I think it would help get everyone on board if some specific and useful examples were given of how this solves real problems (and no I don't really consider black and white holes as solving real problems.  I couldn't even find any non-astronomical uses of the terms in a google search.)

The terms are recent and introduced by the Perl community. I happened to
like the metaphor. The consecrated name is "null object pattern".

> For instance, it would be nice to see some more concrete discussion about
> * the "rails" case.
> * the X = A*B + C matrix/vector expressions case.
> * the case of generating bindings to scripting langauges / ORB stubs
> * the Spirit/parser generator case
> 
> So here's my take on vector expressions since that's the only one I know anything about.
> 
> *Problem statement*:
> Make the expression A=(I-B)*C+D efficient, where the variables are large vectors (I'll leave out matrices for now).
> 
> *Why it's hard*:
> The difficulty is that (ignoring SSE instruction etc) the most efficient way to compute that is do all operations component-wise.  So instead of computing I-B then multiplying by C, you compute
>     A[i] = (I[i]-B[i])*C[i]+D[i];
> for each i.  This eliminates the need to allocate large intermediate vectors.

There's much more than that. (First off, things are more complicated in
the case of matrices.) You want to be gentle on cache, so when you have
any column-wise iteration you want to do matrix blocking. Depending on
the expression, you want to select different block sizes.

Then you also want to do optionally partial unrolling *on top of
blocking*. Again, the amount of unrolling might depend on the
expression. (You don't want to unroll large expressions.) At this point
things are utterly messy.

Iterating may also be better row-wise or column-wise, depending on the
expression. Some subexpressions have a "preferential" row-wise scanning
order and a "possible" column-wise order. Others must do things one way
or the other. For all this the appropriate code must be generated.

> *Existing solutions*:
>   Expression templates in C++, e.g. The Blitz++ library.  Instead of making opSub in I-B return a new Vector object, you make opSub return an ExpressionTemplate object.  This is a little template struct that contains a reference to I and to B, and knows how to subtract the two in a component-wise manner.  The types of I and B are template parameters, LeftT and RightT. Its interface also allows it to be treated just like a Vector.  You can add a vector to it, subtract a Vector from it etc.
> 
> Now we go and try to multiply that result times C.  The result of that is a new MultExpressionTemplate with two paramters, the LeftT being our previous SubExpressionTemplate!(Vector,Vector) and the RightT being Vector.
> 
> Proceeding on in this way eventually the result of the math is of type:
> 
> AddExpressionTemplate!(
>    MultExpressionTemplate!(
>       SubExpressionTemplate!(Vector,Vector),
>       Vector),
>    Vector)
> 
> And you can see that we basically have a parse tree expressed as nested templates.  The final trick is that a Vector.opAssign that takes an ExpressionTemplate is provided and that method calls a method of the expression template to finally trigger the calculation, like expr.eval(this).  eval() has the top-level loop over the components of the answer.
> 
> *Why Existing solutions are insufficient*
> For that all that effort to actually be useful the compiler has to be pretty agressive about inlining everything so that in the end all the temporary template structs and function calls go away and you're just left with one eval call.  It can be tricky to get the code into just the right configuration so that the compiler will do the inlining.  And even then results will depend on the quality of the compiler.  My attempts using MSVC++ several years ago always came out to be slower than the naive version, but with about 10x the amount of code.  The code is also pretty difficult to follow because of all those different types of expression templates that have to be created.
> 
> If you include matrices things are even trickier because there are special cases like "A*B+a*C" that can be computed efficiently by a single optimized routine.  You'd like to recognize such cases and turn them into single calls to that fast routine.  You might also want to recognize "A*B+C" as a special case of that with a==1.
> 
> *How it could be improved*:
> ??? this is what I'd like to see explained better.

Great. One problem is that building ET libraries is exceedingly hard
because of the multiple issues that must be solved simultaneously. To
get a glimpse into the kind of problems that we are talking about, see
e.g. http://www.adtmag.com/joop/carticle.aspx?ID=627. Libraries cannot
afford to implement an optimal solution, partly because they have so
much language-y mud to go through, and partly because the C++ language
simply does not offer the code generation abilities that are needed.

I haven't sat down to design a linear algebra using D's new abilities,
but they are definitely helpful in that specifying an elementary matrix
operation (the core of a loop) only needs one template. For example, if
you want to specify the kernel of a matrix addition, you can say it as a
type:

MatrixOp!("lhs[i, j] + rhs[i, j]", rowwise, columnwise)

The type specifies the kernel of the operation, conventionally expressed
in terms of lhs, rhs, i, and j, then the preferred iteration order, and
finally the alternate order. The MatrixOp template defines a member
function get(uint i, uint j) that expands the string given in the

The kernel of multiplication is:

MatrixOp!("sum!(k, 0, n, lhs[i, k] * rhs[k, j])", rowwise, columnwise,
blocking!(8), unrolling!(8))

(sum is not doable in today's D because D lacks the ability to inject a
new alias name into a template upon invocation.)

This type specifies how an element of the multiplication is obtained,
again what preferred and alternate method of iteration is possible, and
also specifies blocking and unrolling suggestions.

In a complex expression, lhs and rhs will bind to subexpressions; it's
easy to then generate the appropriate code upon assignment to the
target, with heuristically chosen blocking and unrolling parameters
based on the suggestions made by the subexpressions. All this is doable
without difficulty through manipulating and generating code during
compilation.


Andrei

February 10, 2007
Andrei Alexandrescu (See Website For Email) wrote:
> kris wrote:
> 
>> Andrei Alexandrescu (See Website For Email) wrote:
>>
>>>>> I think there is a lot of apprehension and misunderstanding surrounding what metacode is able and supposed to do or simplify. Please, let's focus on understanding _before_ forming an opinion.
>>>>
>>>>
>>>>
>>>> If that's the case, then perhaps it's due to a lack of solid & practical examples for people to examine? There's been at least two requests recently for an example of how this could help DeRailed in a truly practical sense, yet both of those requests appear to have been ignored thus far.
>>>>
>>>> I suspect that such practical examples would help everyone understand since, as you suggest, there appears to be "differences" in perspective? Since Walter brough RoR up, and you apparently endorsed his point, perhaps one of you might enlighten us via those relevant examples?
>>>>
>>>> There's a request in the original post on "The DeRailed Challenge" for just such an example ... don't feel overtly obliged; but it might do something to offset the misunderstanding you believe is prevalent.
>>>
>>>
>>>
>>> I saw the request. My problem is that I don't know much about DeRailed, and that I don't have time to invest in it. 
>>
>>
>> You wrote (in the past):
>> ====
>> I think things would be better if we had better libraries and some success stories.
>> ====
>>
>> We have better libraries now. And we're /trying/ to build a particular success story. Is that not enough reason to illustrate some practical examples, busy though you are? I mean, /we're/ putting in a lot of effort, regardless of how busy our personal lives may be. All we're asking for are some practical and relevant examples as to why advanced DSL support in D will assist us so much.
>>
>>
>>> My current understanding is that DeRailed's approach is basically dynamic, a domain that metaprogramming can help somewhat, but not a lot. The simplest example is to define variant types (probably they are already there) using templates. Also possibly there are some code generation aspects (e.g. for various platforms), which I understand RoR does a lot, that could be solved using metacode.
>>
>>
>> I read "Possibly there ... Could be solved ..."
>>
>> Forgive me, Andrei, but that really does not assist in comprehending what it is that you say we fail to understand. Surely you would agree? Variant types can easily be handled by templates today, but without an example it's hard to tell if that's what you were referring to.
>>
>> On Feb 7th, you wrote (in reference to the DSL discourse):
>> =====
>> Walter gave another good case study: Ruby on Rails. The success of Ruby
>> on Rails has a lot to do with its ability to express abstractions that
>> were a complete mess to deal with in concreteland.
>> ====
>>
>> On Feb 7th, Walter wrote (emphasis added):
>> =====
>> Good question. The simple answer is look what Ruby on Rails did for Ruby. Ruby's a good language, but the killer app for it was RoR. RoR is what drove adoption of Ruby through the roof. /Enabling ways for sophisticated DSLs to interoperate with D will enable such applications/
>> =====
>>
>> You see that subtle but important reference to RoR and DSL in the above? What we're asking for is that one of you explain just exactly what is /meant/ by that. DeRailed faces many of the same issues RoR did, so some relevant examples pertaining to the RoR claim may well assist DeRailed.
>>
>> Do we have to get down on our knees and beg?
> 
> 
> Aw, give me a break.
> 
> Andrei


Hrm ...

Perhaps it should be pointed out that some of us are going to great personal expense and effort to further D in the marketplace. Because of that, what you read above is both a sincere and honest effort to elicit concrete assistance based upon relevant claims made (above).

Your response is not quite as helpful as it might be; but then it would appear to have been intended for other effect? What we really need is some assistance instead.

Thank you;

- Kris
February 10, 2007
kris wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> kris wrote:
>>
>>> Andrei Alexandrescu (See Website For Email) wrote:
>>>
>>>>>> I think there is a lot of apprehension and misunderstanding surrounding what metacode is able and supposed to do or simplify. Please, let's focus on understanding _before_ forming an opinion.
>>>>>
>>>>>
>>>>>
>>>>> If that's the case, then perhaps it's due to a lack of solid & practical examples for people to examine? There's been at least two requests recently for an example of how this could help DeRailed in a truly practical sense, yet both of those requests appear to have been ignored thus far.
>>>>>
>>>>> I suspect that such practical examples would help everyone understand since, as you suggest, there appears to be "differences" in perspective? Since Walter brough RoR up, and you apparently endorsed his point, perhaps one of you might enlighten us via those relevant examples?
>>>>>
>>>>> There's a request in the original post on "The DeRailed Challenge" for just such an example ... don't feel overtly obliged; but it might do something to offset the misunderstanding you believe is prevalent.
>>>>
>>>>
>>>>
>>>> I saw the request. My problem is that I don't know much about DeRailed, and that I don't have time to invest in it. 
>>>
>>>
>>> You wrote (in the past):
>>> ====
>>> I think things would be better if we had better libraries and some success stories.
>>> ====
>>>
>>> We have better libraries now. And we're /trying/ to build a particular success story. Is that not enough reason to illustrate some practical examples, busy though you are? I mean, /we're/ putting in a lot of effort, regardless of how busy our personal lives may be. All we're asking for are some practical and relevant examples as to why advanced DSL support in D will assist us so much.
>>>
>>>
>>>> My current understanding is that DeRailed's approach is basically dynamic, a domain that metaprogramming can help somewhat, but not a lot. The simplest example is to define variant types (probably they are already there) using templates. Also possibly there are some code generation aspects (e.g. for various platforms), which I understand RoR does a lot, that could be solved using metacode.
>>>
>>>
>>> I read "Possibly there ... Could be solved ..."
>>>
>>> Forgive me, Andrei, but that really does not assist in comprehending what it is that you say we fail to understand. Surely you would agree? Variant types can easily be handled by templates today, but without an example it's hard to tell if that's what you were referring to.
>>>
>>> On Feb 7th, you wrote (in reference to the DSL discourse):
>>> =====
>>> Walter gave another good case study: Ruby on Rails. The success of Ruby
>>> on Rails has a lot to do with its ability to express abstractions that
>>> were a complete mess to deal with in concreteland.
>>> ====
>>>
>>> On Feb 7th, Walter wrote (emphasis added):
>>> =====
>>> Good question. The simple answer is look what Ruby on Rails did for Ruby. Ruby's a good language, but the killer app for it was RoR. RoR is what drove adoption of Ruby through the roof. /Enabling ways for sophisticated DSLs to interoperate with D will enable such applications/
>>> =====
>>>
>>> You see that subtle but important reference to RoR and DSL in the above? What we're asking for is that one of you explain just exactly what is /meant/ by that. DeRailed faces many of the same issues RoR did, so some relevant examples pertaining to the RoR claim may well assist DeRailed.
>>>
>>> Do we have to get down on our knees and beg?
>>
>>
>> Aw, give me a break.
>>
>> Andrei
> 
> 
> Hrm ...
> 
> Perhaps it should be pointed out that some of us are going to great personal expense and effort to further D in the marketplace. Because of that, what you read above is both a sincere and honest effort to elicit concrete assistance based upon relevant claims made (above).
> 
> Your response is not quite as helpful as it might be; but then it would appear to have been intended for other effect? What we really need is some assistance instead.
> 
> Thank you;
> 
> - Kris

This is Kafkian, pure and simple.

What am I supposed to reply to this, that I took a 4x cut in pay to do 4x more work in grad school and that therefore I must be helped? Am I to be construed into a bad guy because I don't have the time or the inclination to look into your favorite project? If I don't learn RoR and DeRailed and consequently fail to produce evidence that code generation will help DeRailed, will that serve as proof that code generation is good for nothing? Will I be sued? Will Judge Judy prosecute me on TV? I didn't self-righteously ask how DeRailed can help me with the machine learning and natural language processing problems that I'm tackling.

Listen. I think it's great that you work on a project that you like, and I truly hope it will be successful, and that you will have all the fun in the process. As of me, I already spend too much time deciding what _not_ to do, so fulfilling someone else's sense of entitlement is hardly high on my list. I'm doing my best to participate to this community and to discuss things that I find interesting, with whatever arguments I'm capable of coming with. Just like the next guy. Please allow me to continue this. Thanks.


Good luck,

Andrei
February 10, 2007
Andrei Alexandrescu (See Website For Email) wrote:
> kris wrote:
>> Andrei Alexandrescu (See Website For Email) wrote:
>>>>> I think there is a lot of apprehension and misunderstanding surrounding what metacode is able and supposed to do or simplify. Please, let's focus on understanding _before_ forming an opinion.
>>>>
>>>>
>>>> If that's the case, then perhaps it's due to a lack of solid & practical examples for people to examine? There's been at least two requests recently for an example of how this could help DeRailed in a truly practical sense, yet both of those requests appear to have been ignored thus far.
>>>>
>>>> I suspect that such practical examples would help everyone understand since, as you suggest, there appears to be "differences" in perspective? Since Walter brough RoR up, and you apparently endorsed his point, perhaps one of you might enlighten us via those relevant examples?
>>>>
>>>> There's a request in the original post on "The DeRailed Challenge" for just such an example ... don't feel overtly obliged; but it might do something to offset the misunderstanding you believe is prevalent.
>>>
>>>
>>> I saw the request. My problem is that I don't know much about DeRailed, and that I don't have time to invest in it. 
>>
>> You wrote (in the past):
>> ====
>> I think things would be better if we had better libraries and some success stories.
>> ====
>>
>> We have better libraries now. And we're /trying/ to build a particular success story. Is that not enough reason to illustrate some practical examples, busy though you are? I mean, /we're/ putting in a lot of effort, regardless of how busy our personal lives may be. All we're asking for are some practical and relevant examples as to why advanced DSL support in D will assist us so much.
>>
>>
>>> My current understanding is that DeRailed's approach is basically dynamic, a domain that metaprogramming can help somewhat, but not a lot. The simplest example is to define variant types (probably they are already there) using templates. Also possibly there are some code generation aspects (e.g. for various platforms), which I understand RoR does a lot, that could be solved using metacode.
>>
>> I read "Possibly there ... Could be solved ..."
>>
>> Forgive me, Andrei, but that really does not assist in comprehending what it is that you say we fail to understand. Surely you would agree? Variant types can easily be handled by templates today, but without an example it's hard to tell if that's what you were referring to.
>>
>> On Feb 7th, you wrote (in reference to the DSL discourse):
>> =====
>> Walter gave another good case study: Ruby on Rails. The success of Ruby
>> on Rails has a lot to do with its ability to express abstractions that
>> were a complete mess to deal with in concreteland.
>> ====
>>
>> On Feb 7th, Walter wrote (emphasis added):
>> =====
>> Good question. The simple answer is look what Ruby on Rails did for Ruby. Ruby's a good language, but the killer app for it was RoR. RoR is what drove adoption of Ruby through the roof. /Enabling ways for sophisticated DSLs to interoperate with D will enable such applications/
>> =====
>>
>> You see that subtle but important reference to RoR and DSL in the above? What we're asking for is that one of you explain just exactly what is /meant/ by that. DeRailed faces many of the same issues RoR did, so some relevant examples pertaining to the RoR claim may well assist DeRailed.
>>
>> Do we have to get down on our knees and beg?
> 
> Aw, give me a break.
> 
> Andrei

<rant>

Have you even looked at Tango? Have you seen the amount of effort that the team has put in? Do you understand what it means for the success of D as a real world language?

Do you realize that over the past week, you've been repeatedly ignoring and belittling one of the most code productive and prolific library writers in the D community?

Do you understand that he has real life issues with the way D is specified and implemented that affect the most coherent library effort we have, of which he is (along with Sean Kelly) the primary code contributor?

Do you comprehend that as you seem to have the ear of Walter in language design decisions, kris necessarily must come to you to try and understand said decisions?

For Bob's sake, have some respect for who this man is. Try and be open minded about his concerns.

If you are interested in D being a language that can solve problems for "practical" people, start listening to kris, and stop using D as your personal vehicle for language research.

</rant>

All that aside, I do respect you for the contributions I know you have made in C++ land and here in D land. I hope you continue to enjoy D and contribute your considerable help in its design.

However, I do believe that you should take a step back and realize the context in which you are discussing.
February 10, 2007
Kyle Furlong wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> kris wrote:
>>> Andrei Alexandrescu (See Website For Email) wrote:
>>>>>> I think there is a lot of apprehension and misunderstanding surrounding what metacode is able and supposed to do or simplify. Please, let's focus on understanding _before_ forming an opinion.
>>>>>
>>>>>
>>>>> If that's the case, then perhaps it's due to a lack of solid & practical examples for people to examine? There's been at least two requests recently for an example of how this could help DeRailed in a truly practical sense, yet both of those requests appear to have been ignored thus far.
>>>>>
>>>>> I suspect that such practical examples would help everyone understand since, as you suggest, there appears to be "differences" in perspective? Since Walter brough RoR up, and you apparently endorsed his point, perhaps one of you might enlighten us via those relevant examples?
>>>>>
>>>>> There's a request in the original post on "The DeRailed Challenge" for just such an example ... don't feel overtly obliged; but it might do something to offset the misunderstanding you believe is prevalent.
>>>>
>>>>
>>>> I saw the request. My problem is that I don't know much about DeRailed, and that I don't have time to invest in it. 
>>>
>>> You wrote (in the past):
>>> ====
>>> I think things would be better if we had better libraries and some success stories.
>>> ====
>>>
>>> We have better libraries now. And we're /trying/ to build a particular success story. Is that not enough reason to illustrate some practical examples, busy though you are? I mean, /we're/ putting in a lot of effort, regardless of how busy our personal lives may be. All we're asking for are some practical and relevant examples as to why advanced DSL support in D will assist us so much.
>>>
>>>
>>>> My current understanding is that DeRailed's approach is basically dynamic, a domain that metaprogramming can help somewhat, but not a lot. The simplest example is to define variant types (probably they are already there) using templates. Also possibly there are some code generation aspects (e.g. for various platforms), which I understand RoR does a lot, that could be solved using metacode.
>>>
>>> I read "Possibly there ... Could be solved ..."
>>>
>>> Forgive me, Andrei, but that really does not assist in comprehending what it is that you say we fail to understand. Surely you would agree? Variant types can easily be handled by templates today, but without an example it's hard to tell if that's what you were referring to.
>>>
>>> On Feb 7th, you wrote (in reference to the DSL discourse):
>>> =====
>>> Walter gave another good case study: Ruby on Rails. The success of Ruby
>>> on Rails has a lot to do with its ability to express abstractions that
>>> were a complete mess to deal with in concreteland.
>>> ====
>>>
>>> On Feb 7th, Walter wrote (emphasis added):
>>> =====
>>> Good question. The simple answer is look what Ruby on Rails did for Ruby. Ruby's a good language, but the killer app for it was RoR. RoR is what drove adoption of Ruby through the roof. /Enabling ways for sophisticated DSLs to interoperate with D will enable such applications/
>>> =====
>>>
>>> You see that subtle but important reference to RoR and DSL in the above? What we're asking for is that one of you explain just exactly what is /meant/ by that. DeRailed faces many of the same issues RoR did, so some relevant examples pertaining to the RoR claim may well assist DeRailed.
>>>
>>> Do we have to get down on our knees and beg?
>>
>> Aw, give me a break.
>>
>> Andrei
> 
> <rant>
> 
> Have you even looked at Tango? Have you seen the amount of effort that the team has put in? Do you understand what it means for the success of D as a real world language?
> 
> Do you realize that over the past week, you've been repeatedly ignoring and belittling one of the most code productive and prolific library writers in the D community?
> 
> Do you understand that he has real life issues with the way D is specified and implemented that affect the most coherent library effort we have, of which he is (along with Sean Kelly) the primary code contributor?
> 
> Do you comprehend that as you seem to have the ear of Walter in language design decisions, kris necessarily must come to you to try and understand said decisions?
> 
> For Bob's sake, have some respect for who this man is. Try and be open minded about his concerns.
> 
> If you are interested in D being a language that can solve problems for "practical" people, start listening to kris, and stop using D as your personal vehicle for language research.
> 
> </rant>

Great. There is nothing personal ever, just in case that's not clear, nor I meant disrespect to anyone. As a rule, on the Usenet I reply "ad postum", not "ad hominem". If there were a newsreader feature to hide names, I'd think of using it, if it weren't for losing much of the sense of social dynamics.

For the record, I'm not doing language research, officially or not. So much about presuppositions. :o|

> All that aside, I do respect you for the contributions I know you have made in C++ land and here in D land. I hope you continue to enjoy D and contribute your considerable help in its design.
> 
> However, I do believe that you should take a step back and realize the context in which you are discussing.

If one doesn't like a post, is one allowed to not reply to it?


Andrei
February 10, 2007
Andrei Alexandrescu (See Website For Email) wrote:
> kris wrote:
> 
>> Andrei Alexandrescu (See Website For Email) wrote:
>>
>>> kris wrote:
>>>
>>>> Andrei Alexandrescu (See Website For Email) wrote:
>>>>
>>>>>>> I think there is a lot of apprehension and misunderstanding surrounding what metacode is able and supposed to do or simplify. Please, let's focus on understanding _before_ forming an opinion.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> If that's the case, then perhaps it's due to a lack of solid & practical examples for people to examine? There's been at least two requests recently for an example of how this could help DeRailed in a truly practical sense, yet both of those requests appear to have been ignored thus far.
>>>>>>
>>>>>> I suspect that such practical examples would help everyone understand since, as you suggest, there appears to be "differences" in perspective? Since Walter brough RoR up, and you apparently endorsed his point, perhaps one of you might enlighten us via those relevant examples?
>>>>>>
>>>>>> There's a request in the original post on "The DeRailed Challenge" for just such an example ... don't feel overtly obliged; but it might do something to offset the misunderstanding you believe is prevalent.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> I saw the request. My problem is that I don't know much about DeRailed, and that I don't have time to invest in it. 
>>>>
>>>>
>>>>
>>>> You wrote (in the past):
>>>> ====
>>>> I think things would be better if we had better libraries and some success stories.
>>>> ====
>>>>
>>>> We have better libraries now. And we're /trying/ to build a particular success story. Is that not enough reason to illustrate some practical examples, busy though you are? I mean, /we're/ putting in a lot of effort, regardless of how busy our personal lives may be. All we're asking for are some practical and relevant examples as to why advanced DSL support in D will assist us so much.
>>>>
>>>>
>>>>> My current understanding is that DeRailed's approach is basically dynamic, a domain that metaprogramming can help somewhat, but not a lot. The simplest example is to define variant types (probably they are already there) using templates. Also possibly there are some code generation aspects (e.g. for various platforms), which I understand RoR does a lot, that could be solved using metacode.
>>>>
>>>>
>>>>
>>>> I read "Possibly there ... Could be solved ..."
>>>>
>>>> Forgive me, Andrei, but that really does not assist in comprehending what it is that you say we fail to understand. Surely you would agree? Variant types can easily be handled by templates today, but without an example it's hard to tell if that's what you were referring to.
>>>>
>>>> On Feb 7th, you wrote (in reference to the DSL discourse):
>>>> =====
>>>> Walter gave another good case study: Ruby on Rails. The success of Ruby
>>>> on Rails has a lot to do with its ability to express abstractions that
>>>> were a complete mess to deal with in concreteland.
>>>> ====
>>>>
>>>> On Feb 7th, Walter wrote (emphasis added):
>>>> =====
>>>> Good question. The simple answer is look what Ruby on Rails did for Ruby. Ruby's a good language, but the killer app for it was RoR. RoR is what drove adoption of Ruby through the roof. /Enabling ways for sophisticated DSLs to interoperate with D will enable such applications/
>>>> =====
>>>>
>>>> You see that subtle but important reference to RoR and DSL in the above? What we're asking for is that one of you explain just exactly what is /meant/ by that. DeRailed faces many of the same issues RoR did, so some relevant examples pertaining to the RoR claim may well assist DeRailed.
>>>>
>>>> Do we have to get down on our knees and beg?
>>>
>>>
>>>
>>> Aw, give me a break.
>>>
>>> Andrei
>>
>>
>>
>> Hrm ...
>>
>> Perhaps it should be pointed out that some of us are going to great personal expense and effort to further D in the marketplace. Because of that, what you read above is both a sincere and honest effort to elicit concrete assistance based upon relevant claims made (above).
>>
>> Your response is not quite as helpful as it might be; but then it would appear to have been intended for other effect? What we really need is some assistance instead.
>>
>> Thank you;
>>
>> - Kris
> 
> 
> This is Kafkian, pure and simple.
> 
> What am I supposed to reply to this, that I took a 4x cut in pay to do 4x more work in grad school and that therefore I must be helped? Am I to be construed into a bad guy because I don't have the time or the inclination to look into your favorite project? If I don't learn RoR and DeRailed and consequently fail to produce evidence that code generation will help DeRailed, will that serve as proof that code generation is good for nothing? Will I be sued? Will Judge Judy prosecute me on TV? I didn't self-righteously ask how DeRailed can help me with the machine learning and natural language processing problems that I'm tackling.


What we're asking for, Andrei, is very simple. We're asking (ad nauseam) for you to provide examples of how DSL can assist in the RoR style environment. The one yourself and Walter have referred to.

You've chosen to explicitly avoid doing that, and instead resort to twisting the subject matter around to something that suits your purpose. One could be entirely forgiven for concluding that you have *no* concrete examples, and that all this talk about DSL in the context of RoR (inititated by Walter and backed by yourself) is nothing but empty rhetoric and/or hand-waving. That conclusion would be more than just a little disappointing, so I certainly hope it is not the case?


> Listen. I think it's great that you work on a project that you like, and I truly hope it will be successful, and that you will have all the fun in the process. As of me, I already spend too much time deciding what _not_ to do, so fulfilling someone else's sense of entitlement is hardly high on my list. I'm doing my best to participate to this community and to discuss things that I find interesting, with whatever arguments I'm capable of coming with. Just like the next guy. Please allow me to continue this. Thanks.
> 
> 
> Good luck,
> 
> Andrei

Since you bring it up, working on DeRailed is hardly on the top of my list of exciting and/or interesting projects. However, it is an area I have experience in and it seems like a good platform to further D in the market. Like you, I have rather limited time for this, yet put aside many other important things in my personal life to make this happen; have done for several years now. I don't go parading that particular fact, but you bring it up and it seems you feel many particpants here have nothing better to do.

Thus, it's hard to see your approach here as a furtherment of D in any manner. It would seem you're not helping D, yourself, or anyone else by refusing to help us understand the very concepts that you accuse us of not comprehending. I can't think of a higher form of arrogance.

Perhaps you can rectify that?

- Kris

February 10, 2007
Andrei Alexandrescu (See Website For Email) wrote:
> Kyle Furlong wrote:
>> Andrei Alexandrescu (See Website For Email) wrote:
>>> kris wrote:
>>>> Andrei Alexandrescu (See Website For Email) wrote:
>>>>>>> I think there is a lot of apprehension and misunderstanding surrounding what metacode is able and supposed to do or simplify. Please, let's focus on understanding _before_ forming an opinion.
>>>>>>
>>>>>>
>>>>>> If that's the case, then perhaps it's due to a lack of solid & practical examples for people to examine? There's been at least two requests recently for an example of how this could help DeRailed in a truly practical sense, yet both of those requests appear to have been ignored thus far.
>>>>>>
>>>>>> I suspect that such practical examples would help everyone understand since, as you suggest, there appears to be "differences" in perspective? Since Walter brough RoR up, and you apparently endorsed his point, perhaps one of you might enlighten us via those relevant examples?
>>>>>>
>>>>>> There's a request in the original post on "The DeRailed Challenge" for just such an example ... don't feel overtly obliged; but it might do something to offset the misunderstanding you believe is prevalent.
>>>>>
>>>>>
>>>>> I saw the request. My problem is that I don't know much about DeRailed, and that I don't have time to invest in it. 
>>>>
>>>> You wrote (in the past):
>>>> ====
>>>> I think things would be better if we had better libraries and some success stories.
>>>> ====
>>>>
>>>> We have better libraries now. And we're /trying/ to build a particular success story. Is that not enough reason to illustrate some practical examples, busy though you are? I mean, /we're/ putting in a lot of effort, regardless of how busy our personal lives may be. All we're asking for are some practical and relevant examples as to why advanced DSL support in D will assist us so much.
>>>>
>>>>
>>>>> My current understanding is that DeRailed's approach is basically dynamic, a domain that metaprogramming can help somewhat, but not a lot. The simplest example is to define variant types (probably they are already there) using templates. Also possibly there are some code generation aspects (e.g. for various platforms), which I understand RoR does a lot, that could be solved using metacode.
>>>>
>>>> I read "Possibly there ... Could be solved ..."
>>>>
>>>> Forgive me, Andrei, but that really does not assist in comprehending what it is that you say we fail to understand. Surely you would agree? Variant types can easily be handled by templates today, but without an example it's hard to tell if that's what you were referring to.
>>>>
>>>> On Feb 7th, you wrote (in reference to the DSL discourse):
>>>> =====
>>>> Walter gave another good case study: Ruby on Rails. The success of Ruby
>>>> on Rails has a lot to do with its ability to express abstractions that
>>>> were a complete mess to deal with in concreteland.
>>>> ====
>>>>
>>>> On Feb 7th, Walter wrote (emphasis added):
>>>> =====
>>>> Good question. The simple answer is look what Ruby on Rails did for Ruby. Ruby's a good language, but the killer app for it was RoR. RoR is what drove adoption of Ruby through the roof. /Enabling ways for sophisticated DSLs to interoperate with D will enable such applications/
>>>> =====
>>>>
>>>> You see that subtle but important reference to RoR and DSL in the above? What we're asking for is that one of you explain just exactly what is /meant/ by that. DeRailed faces many of the same issues RoR did, so some relevant examples pertaining to the RoR claim may well assist DeRailed.
>>>>
>>>> Do we have to get down on our knees and beg?
>>>
>>> Aw, give me a break.
>>>
>>> Andrei
>>
>> <rant>
>>
>> Have you even looked at Tango? Have you seen the amount of effort that the team has put in? Do you understand what it means for the success of D as a real world language?
>>
>> Do you realize that over the past week, you've been repeatedly ignoring and belittling one of the most code productive and prolific library writers in the D community?
>>
>> Do you understand that he has real life issues with the way D is specified and implemented that affect the most coherent library effort we have, of which he is (along with Sean Kelly) the primary code contributor?
>>
>> Do you comprehend that as you seem to have the ear of Walter in language design decisions, kris necessarily must come to you to try and understand said decisions?
>>
>> For Bob's sake, have some respect for who this man is. Try and be open minded about his concerns.
>>
>> If you are interested in D being a language that can solve problems for "practical" people, start listening to kris, and stop using D as your personal vehicle for language research.
>>
>> </rant>
> 
> Great. There is nothing personal ever, just in case that's not clear, nor I meant disrespect to anyone. As a rule, on the Usenet I reply "ad postum", not "ad hominem". If there were a newsreader feature to hide names, I'd think of using it, if it weren't for losing much of the sense of social dynamics.
> 
> For the record, I'm not doing language research, officially or not. So much about presuppositions. :o|
> 
>> All that aside, I do respect you for the contributions I know you have made in C++ land and here in D land. I hope you continue to enjoy D and contribute your considerable help in its design.
>>
>> However, I do believe that you should take a step back and realize the context in which you are discussing.
> 
> If one doesn't like a post, is one allowed to not reply to it?
> 
> 
> Andrei

Clearly you haven't understood my intention. I propose to you that such an "anonymous" newsreader would be a terrible thing. As much as you would like it, human context DOES have a role in any discussion.

For example, the fact that you are continuing to ignore, which is that kris is not just some guy with an idea of where D should go, as I've already outlined.

If you simply reply to his posts with the idea that you are having an abstract argument about the ideals of creating a language, you will fail to address any of his real issues.

Even if it were the case that you ignore all personality, you still have the monumental arrogance to presume that you do not have to supply evidence for your assertions.

I understand that you are a successful computer scientist. I accept that you have had success with some books on the subject. I respect that you currently research in the field. None of this allows you the freedoms you have taken in the discussions you have been having.

February 10, 2007
Kyle Furlong wrote:
> Andrei Alexandrescu (See Website For Email) wrote:

> I understand that you are a successful computer scientist. I accept that you have had success with some books on the subject. I respect that you currently research in the field. None of this allows you the freedoms you have taken in the discussions you have been having.

Wow, this is sounding sillier and sillier.
It seems pretty clear to me that the answer is simply that Andrei doesn't really know enough about RoR give a concrete example of how better metaprogramming would be useful for DeRailed.  He pretty much said as much in the last mail.  But it would be good if he gave some more practical, concrete examples of places where it would help.

Note that what's going on here is *talk* about features that may or may not get into DMD any time soon.  In fact you could say this whole discussion has been about *preventing* features from getting introduced.  At least in an ad-hoc manner. This meat of this metaprogramming discussion started with Walter saying he was thinking of adding compile time regexps to the language.  Without any discussion about whether that's a good thing or not and what the ramifications are, then it's just going to happen, whether it's good for D or not.  So the question becomes what should D look like?  Rather than add hoc features, what do we really want D's metaprogramming to look like?

To me the discussion has all been about figuring out a clear picture of what things *should* look like in the future w.r.t. metaprogramming in order to convince Walter that throwing things in ad-hoc is not the way to go.  Or maybe to find out that what he's thinking of throwing in isn't so ad-hoc after all and actually makes for a nice evolutionary step towards where we want to go.

As for whether that would help DeRailed, I dunno.  Sounds like kris has a pretty clear idea that reflection would be much more useful to DeRailed.

As for whether DeRailed will help D, I also don't know.  I kinda wonder though, becuase if someone wants RoR, why wouldn't they just use RoR? Seems like it's a tough battle to unseat a champ like that.  I would think that D would have a better shot at dominating by providing a great solution to a niche which is currently underserved.  But that's just my opinion.  Also I don't do web development, so that may be another part of it.  But the description given of what Rails does so well, with all kinds of dynamic this and on-the-fly that, really sounds more like what a scripting language is good at than a static compile-time language.  I mean the dominant web languages are Perl, Python, Ruby, Php, and Javascript.  Not a compiled language in the bunch.  There's must be a reason for that.  Even Java is interpreted bytecode.

As for Andrei having Walter's ear.  I think Andrei has Walter's ear mostly because Andrei is interested in the same kinds of things that interest Walter.  I think everyone can tell by now that Walter pretty much works on solving the problems that interest him.   Right now (and pretty much ever since 'static if') the thing that seems to interest him most is metaprogramming.  Hopefully some day he'll get back to being interested in reflection.  But if he's really got the metaprogramming bug, then that may not be until after he's got D's compile time framework to a point where he feels it's "done".  But only Walter knows.



--bb
February 10, 2007
ugh, snip

At the end of the day it seems as if there has been miscommunication throughout, I mean.. RoR's expressiveness has nothing to do with RoR directly, it's Ruby. By design D is never going to be as expressive as Ruby. Of course that's an objective comment, but how minimal, and how readable Ruby can be written in is a compliment to it's very own language. However, if you're ever curious, may look at the parser for Ruby's language, wow (and people working on D's for various reasons have a lot less headaches without it)

Ruby is by design something that can *produce* a dsl easily. There's even talk of some in the Java camp on dropping ANT for a full language (jruby : rake).

 In some posts it seems like the conversation is consuming them, and in some posts it's about building them, this thread is seemingly hard to follow.

A problem domain that would be YAML, it needs specifics internally, it needs the ability to consume and generate, and it's starting to get decent support. To me, that would be a decent example, even if it was done through community involvement.