upvote
No a language doesn’t need it. It’s an educational tool for those new to the language or new to a particular language feature. With practice language features just become automatic so you don’t think about them when thinking about a problem.

In the README example, the C++ practitioner just doesn’t think about those automatically synthesized copy constructors and such for POD types, nor do they think about the fact that assignment is desugared to operator= or that an assignment can involve a static_cast.

reply
>> needs (or at least is of good use) such a tool.

Of course there are people who do not need that tool. The thing is, other languages doesn’t need such an explanation tool at all, is very much enough with reading a small book. I personally would like C++ to not really need it, but clearly as I stated: maybe “the only one”

reply
> other languages doesn’t need such an explanation tool at all

Plain old C has -E to expand macros. Rust has cargo expand. Haskell has -ddump-simpl. Common Lisp has macroexpand. Any language that has a complicated syntax or allows the user to customize the syntax needs such a tool. Whether such a tool actually exists reflects more on popularity and community desire.

reply
>other languages doesn’t need such an explanation tool at all

Are you sure about that?

reply
In what language is compiling simple? Do you not like compiled languages? I'm not sure what you're complaining about here.
reply
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.

reply
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.
reply
Classical Lisp 1.5 yeah, modern Lisps not so much, hence why there are famous publications like Lisp In Small Pieces.

Only if you mean K&R C or the early C89/90 compilers, before the extension explosion, newer language standards, and modern ISAs.

reply
You have misunderstood the language and the tool.

Compilers for all languages have the concept of "lowering" the level of source-language abstractions from high-level to low-level viz. Written Source -> Simpler Source -> AST -> IR -> Machine Code. One type is "desugaring" i.e. transforming complex syntax to simpler ones so that the following stages of compilation have to operate only on a smaller and hence more manageable language subset.

This tool shows both desugaring and other lowering (eg. implicit transformations, type deductions etc.) within the C++ source language by regenerating the source from the AST thus giving you full visibility until that stage in the compilation process.

PS: Explanatory video presentation by the author - https://www.youtube.com/watch?v=VJ6ZvDRYzNE&t=558s

reply
I don't think it's only C++ though, Python decorators, Rust macros, almost every language's compiler write code you never see. C++ just does more of it and makes it harder to guess. Being able to look at the expanded version is useful in any language that does this.
reply