libclang refactoring tool talk proposed for C++ Now! 2014

Hi Group,

Here is a talk I proposed for C++ Now! 2014:

Title: Create Your Own Refactoring Tool With clang
Session: 90 minute tutorial
Audience: users and developers

  Refactoring tools for C++ have lagged those available in other
  languages. We've all heard the excuses about how C++ is too hard
  to parse and too hard to reason about. Well, get ready to have your
  socks blown off by the tooling infrastructure provided with clang that
  makes writing refactoring tools simple and easy.

  In this talk, I will incrementally develop a refactoring tool with
  clang that transforms a void function argument list (void) to an empty
  argument list ().

  Biography: Richard Thomson is a passionate software craftsman.
  He has been writing C programs since 1980 and C++ programs since 1993.
  For 10 years, Richard was a Microsoft MVP for Direct3D, Microsoft's
  native C++ API for 3D graphics. His book on Direct3D is available
  as a free download. Prior to that, Richard was a technical reviewer
  of the OpenGL 1.0 specification. He is the director of the Computer
  Graphics Museum in Salt Lake City, Utah.

If you have any suggestions for things that could improve this talk
based on this outline, I'd love to hear them.

After I suggested this refactoring as a feature for clang-modernize, I
received a private suggestion that this project would make an
excellent tutorial for writing your own refactoring tool using
libtooling. I liked that idea, but haven't had time to write up a
blog post on it yet (work has been busy...). When C++ Now! 2014
sent out a call for submissions, I decided that was a good time to act
on the suggestion to turn this into a tutorial.

As much as possible, I like my talks to be "live coding", although it
generally helps if you cheat like they do on the cooking shows ...
"set that on 350 degrees for 2 hours... and here we have one that we've
already baked". My point is that I like to emphasize the coding and
not the talking. I think it helps makes tutorials more concrete and
less abstract.

Hi Group,

Here is a talk I proposed for C++ Now! 2014:

Title: Create Your Own Refactoring Tool With clang
Session: 90 minute tutorial
Audience: users and developers

  Refactoring tools for C++ have lagged those available in other
  languages. We've all heard the excuses about how C++ is too hard
  to parse and too hard to reason about. Well, get ready to have your
  socks blown off by the tooling infrastructure provided with clang that
  makes writing refactoring tools simple and easy.

  In this talk, I will incrementally develop a refactoring tool with
  clang that transforms a void function argument list (void) to an empty
  argument list ().

  Biography: Richard Thomson is a passionate software craftsman.
  He has been writing C programs since 1980 and C++ programs since 1993.
  For 10 years, Richard was a Microsoft MVP for Direct3D, Microsoft's
  native C++ API for 3D graphics. His book on Direct3D is available
  as a free download. Prior to that, Richard was a technical reviewer
  of the OpenGL 1.0 specification. He is the director of the Computer
  Graphics Museum in Salt Lake City, Utah.

If you have any suggestions for things that could improve this talk
based on this outline, I'd love to hear them.

After I suggested this refactoring as a feature for clang-modernize, I
received a private suggestion that this project would make an
excellent tutorial for writing your own refactoring tool using
libtooling.

Very cool. Is this based off of libclang or libtooling (normally we refer
to libclang to mean the stable "C" interface). If it is indeed libtooling,
I wouldn't say "libclang", as otherwise that might be confusing...

In article <CAOsfVvn2kTSD6S9wZhtbmpH-YDHwBKucDs21s-oVkeyzhK0dRg@mail.gmail.com>,
    Manuel Klimek <klimek@google.com> writes:

Looks great! It’s true that too many C++ parsers ARE complicated. That’ll be a great talk. Now all we need is libclang binaries for Windows…

In article <CAO41-mP+ZaV1VW0XwEa1kV0V2g1-MLhahyUr+d+bBh3M8O8w_A@mail.gmail.com>,
    Ryan Gonzalez <rymg19@gmail.com> writes:

Looks great! It's true that too many C++ parsers ARE complicated. That'll
be a great talk. Now all we need is libclang binaries for Windows...

For what its worth, I created my refactoring tool on Windows :slight_smile:

It wasn't particularly hard; hacking up the compiler tools JSON was
the hardest part.

In article <
CAOsfVvn2kTSD6S9wZhtbmpH-YDHwBKucDs21s-oVkeyzhK0dRg@mail.gmail.com>,
    Manuel Klimek <klimek@google.com> writes:

> > After I suggested this refactoring as a feature for clang-modernize, I
> > received a private suggestion that this project would make an
> > excellent tutorial for writing your own refactoring tool using
> > libtooling.
>
> Very cool. Is this based off of libclang or libtooling (normally we refer
> to libclang to mean the stable "C" interface). If it is indeed
libtooling,
> I wouldn't say "libclang", as otherwise that might be confusing...

I prototyped my example using remove-cstr-calls as a guide and it is based
on libtooling.

Then I'd just make sure to not call it "libclang" anywhere in the talk, as
otherwise that might confuse people. Looking forward to your presentation :slight_smile:

In article <CAOsfVvkA2JNO4tsi7cQcXkk-2VGqkeGm-Vgw-ynEmZUHAXEHzw@mail.gmail.com>,
    Manuel Klimek <klimek@google.com> writes:

Then I'd just make sure to not call it "libclang" anywhere in the talk, as
otherwise that might confuse people. Looking forward to your presentation :slight_smile:

Good point. I just reviewed my talk description and I referred to it
as the "tooling infrastructure provided with clang" and only made
mention of libclang on my post to this mailing list.

Everything I prototyped was made using libtooling :slight_smile:

-- Richard