[go: up one dir, main page]

|
|
Log in / Subscribe / Register

Semantic patching with Coccinelle

Semantic patching with Coccinelle

Posted Jan 22, 2009 16:28 UTC (Thu) by padator (guest, #56235)
In reply to: Semantic patching with Coccinelle by rwmj
Parent article: Semantic patching with Coccinelle

> OCaml actually supports the principle of semantic patching natively.

This is not true. What you are talking about is different and is called
meta-programming. The need to refactor code is different. Even in OCaml
you often need to refactor code and there is no tool right now for OCaml
that does that. In fact we, in the coccinelle project, had in the past internally needed to refactor the coccinelle code and it was painful.

So I guess the comment of the other guy was right on the point; we decided to do
a semantic patching tool for C rather than a semantic patching tool for OCaml because there are more people writing C code :)


to post comments

Semantic patching with Coccinelle

Posted Jan 23, 2009 0:42 UTC (Fri) by nix (subscriber, #2304) [Link]

Obviously, for symmetry, the thing to do is to write a semantic patching
tool (called, perhaps, ocamelle), in C, which carries out such
transformations on OCaml code. ;}

Semantic patching with Coccinelle

Posted Jan 23, 2009 5:38 UTC (Fri) by rwmj (guest, #5474) [Link]

I didn't mean that semantic patching was used in the same way as metaprogramming, but they are certainly analogous to each other. In one case, the transformed code is applied as a patch back on the source. In the other case, the transformed code is immediately passed to the compiler.

Anyhow .. for OCaml refactoring, Jane Street sponsored this project last summer. It's also something that Eclipse + the OCaml Eclipse plugin claims to do. I have not used either.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds