‹ BackHN Continuity

Thread

C++ Insights – See your source code with the eyes of a Compiler

172 points · 36 comments · rramadass

  1. f1shy · · focus · HN ↗
    I must be the only one who (while I like the tool) feel a little strange, somewhere between sad, angry, annoyed and disappointed (can’t really express it), that a language needs (or at least is of good use) such a tool.

    Like: I wish what is the first interpretation of my code to be obvious. Is not about advanced optimization, or nitty gritty compiler tricks, is about the language. This tool is useful in any C++ compiler. How did we end with such a complex language?

    I mean (sorry, very personal take) the programming language is for me a tool to help me think about a problem and its solution. In this era of LLM more than before, is not a tool to get the machine to do something, is a language for formalizing ideas, problems and solutions, like math. Should not be so obscure, that you need to be a lawyer to understand it, right? Or I am very much old and totally in the weeds with my ideas?

    1. esikich · · focus · HN ↗
      In what language is compiling simple? Do you not like compiled languages? I'm not sure what you're complaining about here.
      1. f1shy · · focus · HN ↗
        Lisp is simple to compile. Even C (at the level this tool works anyway), also basic, and maybe other 100 languages (again, not the whole compiler, but what this tool shows).

        Compilation per se is not difficult. Doing it with good error recovery, good feedback in case of error, and the optimization is difficult.

        This tool does not tell me those parts (for that is gotbolt) this is about how the first layer of interpretation works, and not for making compilers, but for understanding what the code actually means, because is not obvious at first sight.

        1. dasyatidprime · · focus · HN ↗
          I agree with an overall thrust of “C++ is overcomplicated and has many moving parts and a lot of implicit stuff happening in the background that makes it difficult to understand”. But I do want to briefly note that Lisp environments have macro expansion steppers for a reason too.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.