Front-end tools, Coccinelle and acceleration

bearophile bearophileHUGS at
Mon Feb 6 17:23:05 PST 2012

>From a recent blog post by Bartosz Milewski ( ):

>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 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:

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.


More information about the Digitalmars-d mailing list