C++ Insights – See your source code with the eyes of a Compiler
Thread
Loading the complete thread in the background. This saved snapshot is available now. Refresh
Unofficial Hacker News client; not affiliated with Y Combinator.
C++ Insights – See your source code with the eyes of a Compiler
Loading the complete thread in the background. This saved snapshot is available now. Refresh
Unofficial Hacker News client; not affiliated with Y Combinator.
rramadass · · focus · HN ↗
[deleted] · · focus · HN ↗
[deleted]
StilesCrisis · · focus · HN ↗
mrlonglong · · focus · HN ↗
rramadass · · focus · HN ↗
mrlonglong · · focus · HN ↗
rramadass · · focus · HN ↗
kccqzy · · focus · HN ↗
WalterBright · · focus · HN ↗
sltkr · · focus · HN ↗
Here's an example: <a href="https://cppinsights.io/s/f04b6896" rel="nofollow">https://cppinsights.io/s/f04b6896
StilesCrisis · · focus · HN ↗
frabert · · focus · HN ↗
Someone · · focus · HN ↗
alankarmisra · · focus · HN ↗
<a href="https://youtu.be/ZPGysUX62OY" rel="nofollow">https://youtu.be/ZPGysUX62OY
ranger_danger · · focus · HN ↗
jsrcout · · focus · HN ↗
IshKebab · · focus · HN ↗
drysine · · focus · HN ↗
pjmlp · · focus · HN ↗
f1shy · · focus · HN ↗
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?
rs545837 · · focus · HN ↗
kccqzy · · focus · HN ↗
f1shy · · focus · HN ↗
drysine · · focus · HN ↗
Are you sure about that?
kccqzy · · focus · HN ↗
esikich · · focus · HN ↗
f1shy · · focus · HN ↗
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.
dasyatidprime · · focus · HN ↗
pjmlp · · focus · HN ↗
rramadass · · focus · HN ↗
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 - <a href="https://www.youtube.com/watch?v=VJ6ZvDRYzNE&t=558s" rel="nofollow">https://www.youtube.com/watch?v=VJ6ZvDRYzNE&t=558s
jcelerier · · focus · HN ↗
tweedler290 · · focus · HN ↗
abbefaria27 · · focus · HN ↗
kvemkon · · focus · HN ↗
What I'd like to see, is how many time is spent to compile each block of C++ code (sliced as fine as possible).
veexx103 · · focus · HN ↗
Can these issues be resolved?
kizxc4395 · · focus · HN ↗
jruohonen · · focus · HN ↗
<a href="https://cppinsights.io/" rel="nofollow">https://cppinsights.io/
aktenlage · · focus · HN ↗