www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Optimizing delegates

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

 On 12/19/10 11:17 AM, Andrei Alexandrescu wrote:
 Inlining delegates is technically much more difficult than inlining
 aliases. This is because a different function will be generated for each
 alias argument, whereas only one function would be used for all
 delegates. There are techniques to address that in the compiler, but
 they are rather complex.

Let me add that good Lisp programmers understand that very well. Seasoned Lisp experts seldom use the textbook lambdas as can be seen in all Lisp books and that rank and file Lisp programmers use everywhere. Experts use macros because they understand their advantages (of which speed is an important one).

It's only complex if you're an incompetent compiler writer. I knew whole the time the main reason was someone's incompetence. You needed two posts to defend W. Poor man. I can't guess how extensively you've tested modern implementations of functional languages lately, but it's possible that some Lisp implementations don't inline small lambdas in cases like this. In general, passing small lambdas is as common in functional programming as semicolons in D. Would be strange if they didn't optimize them well nowadays.
Dec 19 2010
parent reply Walter Bright <newshound2 digitalmars.com> writes:
loser wrote:
 It's only complex if you're an incompetent compiler writer.

I can confirm that it is complex.
Dec 31 2010
parent so <so so.do> writes:
lol

(Sorry couldn't resist!)

On Sat, 01 Jan 2011 04:00:37 +0200, Walter Bright  
<newshound2 digitalmars.com> wrote:

 loser wrote:
 It's only complex if you're an incompetent compiler writer.

I can confirm that it is complex.

Jan 01 2011