Hacker News new | past | comments | ask | show | jobs | submit login

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)



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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: