www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Front-end tools, Coccinelle and acceleration

From a recent blog post by Bartosz Milewski
(http://bartoszmilewski.com/2012/02/06/call-your-headhunter/ ):

Chandler Carruth had an interesting talk about the progress of the Clang
project. They have open-sourced their C++ front-end and made possible the
creation of smart tools that can work on very large C++ projects. Large
projects sooner or later enter the stage when maintenance is nightmare.
Chandler demonstrated that it doesn’t have to be so. Instead of propagating a
top-level modification by hand through millions of lines of code, you can write
a short program that uses the C++ front-end to make exactly the modifications
that are needed -- more reliably than a human. This includes understanding and,
if necessary, modifying macros.<
In https://github.com/D-Programming-Language/dmd/ I have seen several times long patches that have required a long time to be created, despite they are boring and are just a repetition of the same little change carried on a lot of code. More tools to perform similar boring tasks more automatically will probably improve the life of future D programmers, so I think they are important for the spreading of D language. There is Coccinelle, able to perform semantic patching: http://coccinelle.lip6.fr/ http://lwn.net/Articles/315686/ Coccinelle is nice, but I don't know how badly it works on D code, and if you want to use it you need some time to learn its pattern language. Beside tools like Coccinelle, that surely it's possible to write for D too, is it possible to improve the D language (or the D front-end, to give something like those smart Clang tools) to help future refactoring tools? Experience has shown that such meta-tools (like GitHub) are sometimes very useful. Bye, bearophile
Feb 06 2012