www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Why Ruby?

reply loser <noneedtotalkanymore to.me> writes:
Andrei Alexandrescu Wrote:

 On 12/19/10 11:54 AM, foobar wrote:
 Andrei Alexandrescu Wrote:

 Either way, I personally don't care that much for another syntax for
delegates. I personally just want to see this ugly hack removed from the
standard library and discouraged. This feature promotes a code smell. And for
what, as you said yourself, to save 4 characters?

"a> b" vs. (a, b) { return a> b; } Savings: 17 characters.

I reserve the right to dislike it even if it was 20 characters. The fact that it's a useful hack doesn't make it smell less.

It doesn't smell. You believe it does only because you mistakenly believe it's not hygienic.
 D should be consistent with only ONE delegate syntax. This is why Ruby reads
like poetry to its followers and c++ is like carving letters in stone.

Also, Ruby is well slower than C++ and other languages. It's easy to design a beautiful language if that's the primary concern. It's difficult to design a language when you want to keep in harmony a larger list of desiderata.
 I much prefer that the lowering you mentioned to be implemented so that
performance wise this UGLY hack will have no benefits.

The lowering will unfortunately solve little. I don't see how sort!"a> b"(array); is horrible but sort(a, b; array) { return a> b; }

I wasn't referring to the above which still deals with the syntactic issue. I'm talking about making: sort!"a>b"(whatever); and sort(whatever, (a, b) { return a>b; }); have the same performance. Thus obviating the need for the first form.

I explained how this is much more difficult than it might seem at first sight.

Your only argument was that it's more difficult because it's more difficult and even the great lisp gods won't do that. Listen, we see through your bluff. Do I need to list you the names of 10 functional language compilers that actually do this optimization. It might even be the case that LDC optimizes this unlike DMD.
Dec 19 2010
parent Caligo <iteronvexor gmail.com> writes:
--001636c926276c8cab0497d2676e
Content-Type: text/plain; charset=ISO-8859-1

 Your only argument was that it's more difficult because it's more difficult
 and even the great lisp gods won't do that. Listen, we see through your
 bluff. Do I need to list you the names of 10 functional language compilers
 that actually do this optimization. It might even be the case that LDC
 optimizes this unlike DMD.

"Talk is cheap. Show me the code." --Linus Torvald --001636c926276c8cab0497d2676e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margi= n: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-le= ft: 1ex;"> Your only argument was that it&#39;s more difficult because it&#39;s more d= ifficult and even the great lisp gods won&#39;t do that. Listen, we see thr= ough your bluff. Do I need to list you the names of 10 functional language = compilers that actually do this optimization. It might even be the case tha= t LDC optimizes this unlike DMD.<br> </blockquote></div><br><br>&quot;Talk is cheap. Show me the code.&quot; --L= inus Torvald<br> --001636c926276c8cab0497d2676e--
Dec 19 2010