• resipsaloquitur@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 month ago

    The problem with C is that other languages can’t natively use C libraries without a shim? What is this nonsense?

    And the article carps on about parsing headers — as if headers are a thing in C. The #include preprocessor macro will include —whatever— the parameter is. It doesn’t even have to be a file. Using #include <something.h>will include files that don’t exist if the compiler “finds” something.h internally. As opposed to #include "something.h" which will fail if something.h isn’t a real file in the include path. So I’m not sure what the author is getting at about parsing headers.

    And int is different sizes on different platforms. Not exactly a hot take — that’s been a hassle for decades. Or a benefit, if you want your representation to grow as platforms grow over decades. Regardless, it’s largely solved by using stdint.h. Much worse is the fact that the definition of a char is that it has to be at least 8 bits. And in some cases is 16 bits.

    Why does Python use C libraries under the hood? Because they’re fast and free. If you don’t like it, write your own libraries.