Making the Clang AST Leaner and Faster

(cppalliance.org)

31 points | by vitaut 5 hours ago ago

6 comments

  • wild_pointer 3 hours ago

    Impressive work! Also waiting for fine-grained caching:

    https://discourse.llvm.org/t/rfc-add-an-llvm-cas-library-and...

    • nicwilson an hour ago

      That is dated Feb 2022. Do you know if anything came of it?

  • jiehong 3 hours ago

    Great stuff!

    But, I’m afraid it will actually lead to even more heavily templated C++ in a rebound effect!

  • gnusi 4 hours ago

    That's awesome improvement!

  • reactordev 2 hours ago

    >Modern C++ codebases — from browsers to GPU frameworks — rely heavily on templates, and that often means massive abstract syntax trees.

    Symptom of a symptom. Templates are abhorrent abominations. However, there’s no way to do generics without them. It just becomes a hairball mess at compile time… kudos for alleviating some of the pain in waiting.

    • o11c 26 minutes ago

      The C++ implementation, sure. But there is plenty of other implementation space without giving up like Java.

      With a trait-first implementation that mostly defers monomorphization and prefers "static if" over C++-style specialized implementations, the only hard choice is whether to optimize codegen for size or speed.

      Trying to retrofit this onto standard C++ is ... not actually as difficult as you might think. The real problem is the implementation of builtins that rely heavily on "this really must be a constant during X phase of compilation".