User: Password:
|
|
Subscribe / Log in / New account

Semantic patching with Coccinelle

Semantic patching with Coccinelle

Posted Jan 22, 2009 5:43 UTC (Thu) by i3839 (guest, #31386)
In reply to: Semantic patching with Coccinelle by Yorick
Parent article: Semantic patching with Coccinelle

You're right for (semi) long-term contributors. But for people who just want to make a quick fix or other small contribution a for them strange language is a sort of hurdle. Perhaps big enough to miss quite a few long-term contributors who normally would have started with something small.

That said, how the reception of outside contributions is by the main developers has a bigger impact than what language is used...


(Log in to post comments)

Semantic patching with Coccinelle

Posted Jan 22, 2009 10:37 UTC (Thu) by Yorick (subscriber, #19241) [Link]

Thank you, that is a valid objection; small contributions are likely to be inhibited by the use of an unfamilar language. But not all of them; trivial typo fixes, translations, ports, build and configuration changes etc do not require much understanding of the language. Nor do testing and reporting bugs, perhaps the most important class of small contributions.

But what I really wanted to challenge is the sad prevailing idea that some languages are "common" and the rest "strange". The statement in the article could be interpreted that way, although I am confident that Ms Henson does not suffer from that delusion herself. It is not helpful in making "uncommon" languages less so, even when this has great merit.

(Also, some "helpful" contributions that you receive as a maintainer of a free software package makes you wonder if the language-as-barrier is such a bad idea...)

Semantic patching with Coccinelle

Posted Jan 22, 2009 13:43 UTC (Thu) by hppnq (guest, #14462) [Link]

But what I really wanted to challenge is the sad prevailing idea that some languages are "common" and the rest "strange".

To prove your point, maybe you should write patches for Coccinelle so that it can produce semantic patches for OCaml?

Semantic patching with Coccinelle

Posted Jan 22, 2009 16:18 UTC (Thu) by rwmj (subscriber, #5474) [Link]

To prove your point, maybe you should write patches for Coccinelle so that it can produce semantic patches for OCaml?

OCaml actually supports the principle of semantic patching natively. You can perform almost arbitrary transformations of the abstract syntax tree at compile time, and this feature is used to implement interesting new features like Erlang-style bitstrings, type-safe access to databases, type-safe regular expressions, and much more.

Of course this is "strange" to many. (LISP programmers might recognise them as a very much more powerful version of LISP macros). But this is just one of the several ways that OCaml (and Haskell) are far beyond common programming languages.

Rich.

Semantic patching with Coccinelle

Posted Jan 22, 2009 16:28 UTC (Thu) by padator (guest, #56235) [Link]

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

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 (subscriber, #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 © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds