from Hacker News

Driving Compilers (2023)

by misonic on 5/5/25, 2:17 AM with 30 comments

  • by Timwi on 5/5/25, 7:24 AM

    I share the frustration the author describes. When I started out programming as a child, I used Turbo Pascal, but I was aware of Turbo C and that more people used that than Pascal. Nevertheless, I couldn't really wrap my head around C at the time, and it was partly due to linker errors that I couldn't understand; and it seemed that Turbo Pascal just didn't use a linker, so it was easier to understand and tinker with at age 9.

    It's intriguing to think how different my experience could have been if educational material at the time had focused as much on full explanations of the compiler+linker process, including example error conditions, as it did on teaching the language.

    30 years later, I like to claim that I have a reasonably workable understanding of how compilers work, but I'm still nebulous on how linkers do what they do. I'm much more comfortable with higher-level compilers such as C# that compile to a VM bytecode (IL) and don't worry about linkers.

  • by lynx97 on 5/5/25, 6:44 AM

    Nitpick: Almost all Hello World C examples are wrong. printf is for when you need to use a format string. Hello World doesn't. Besides:

    > puts() writes the string s and a trailing newline to stdout.

    int main() { puts("Hello World!"); }

  • by stef-13013 on 5/5/25, 11:06 AM

    Really nice, thanks !!