News for hackers. Stuff that matters.
Re:Dynamic Languages Strike Back by inklesspen on Monday May 12, 2008 @01:37PM (#187765)
I thought he was talking about functions defined within the same file or some such.

Like:

    int square(int x) {
        return x*x;
    }
    int sum_of_squares(int x, int y) {
        return square(x)+square(y);
    }
And then the compiler could just know to turn that into

    int sum_of_squares(int x, int y) {
        return x*x + y*y;
    }
(apologies if my syntax is invalid; I'm not actually a C programmer)
Re:Dynamic Languages Strike Back by boris on Tuesday May 13, 2008 @03:10AM (#188363)
Steve is talking about the "link-time inlining" (see the original quote) which is not supported by any mainstream C compiler that I know.

Inlining in the same translation unit is possible though its application is too limited to explain why C is faster than dynamically-typed languages.