C++ vs Lisp

Dee Girl deegirl at noreply.com
Sat May 17 16:13:14 PDT 2008


Nick Sabalausky Wrote:

> "Dee Girl" <deegirl at noreply.com> wrote in message 
> news:g0nfdd$1c2m$1 at digitalmars.com...
> > bearophile Wrote:
> >
> >> Walter Bright:
> >> > An oldie, but some very thought provoking observations on what makes a
> >> > language productive:
> >> > http://faculty.cs.byu.edu/~irenelg/courses/330/CTM/Resources/C++-vs-Lisp.txt
> >>
> >> Dear Walter, take a look at my libs, they are much better than the 
> >> EasySTL he talks about:
> >> http://www.fantascienza.net/leonardo/so/libs_d.zip
> >
> > You have send these libraries earlier to me. Thank you for that! It looks 
> > interesting. But one problem is you use delegates. They are much slower 
> > than alias. I measured 3 - 5 times slower depending on task.
> >
> 
> Can you give an example of what you mean by using alias instead of 
> delegates? 

There was long discussion here. Maybe you did not read.

void slowbad(delegate void() f)
{
    f();
}

void fastgood(alias f)()
{
    f();
}

void main() 
{
    void f() { }
    slowbad(&f);
    fastgood!(f);
}

Syntax is different but power is very different. std.algorithm uses alias always. Everybody else uses slowbad ^_^ Dee Girl



More information about the Digitalmars-d mailing list