All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] Coccinelle for other programming languages
@ 2015-12-17 16:38 Dharmalingam Ganesan
  2015-12-17 17:28 ` Julia Lawall
  0 siblings, 1 reply; 12+ messages in thread
From: Dharmalingam Ganesan @ 2015-12-17 16:38 UTC (permalink / raw)
  To: cocci

Hi,
Coccinelle sounds very interesting. I'm curious whether you can comment on any other tools for other programming languages.

Thanks a lot.
Dharma

Dr. Dharmalingam Ganesan, PhD
Senior Research Scientist
Fraunhofer Center for Experimental Software Engineering (CESE)
5825 University Research Court (Suite 1300)
College Park, Maryland 20740

Tel: 240 487 2915

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20151217/0049248e/attachment.html>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Cocci] Coccinelle for other programming languages
  2015-12-17 16:38 [Cocci] Coccinelle for other programming languages Dharmalingam Ganesan
@ 2015-12-17 17:28 ` Julia Lawall
  2015-12-17 22:11   ` Luis R. Rodriguez
  2015-12-18  8:00   ` SF Markus Elfring
  0 siblings, 2 replies; 12+ messages in thread
From: Julia Lawall @ 2015-12-17 17:28 UTC (permalink / raw)
  To: cocci

On Thu, 17 Dec 2015, Dharmalingam Ganesan wrote:

>
> Hi,
>
> Coccinelle sounds very interesting. I?m curious whether you can comment on any other tools for other programming languages.

Coccinelle doesn't support any languages other than C, and a small amount
of C++.  For C++, it parses the C-like parts of the code, and ignores the
rest.  It could be conceptually possible to design a version of Coccinelle
for other languages, but it would require a lot of development work, so
funding would be required.

julia

>
> ?
>
> Thanks a lot.
>
> Dharma
>
> ?
>
> Dr. Dharmalingam Ganesan, PhD
>
> Senior Research Scientist
>
> Fraunhofer Center for Experimental Software Engineering (CESE)
>
> 5825 University Research Court (Suite 1300)
>
> College Park, Maryland 20740
>
> ?
>
> Tel: 240 487 2915
>
> ?
>
>
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Cocci] Coccinelle for other programming languages
  2015-12-17 17:28 ` Julia Lawall
@ 2015-12-17 22:11   ` Luis R. Rodriguez
  2015-12-18  8:09     ` SF Markus Elfring
  2015-12-18  8:00   ` SF Markus Elfring
  1 sibling, 1 reply; 12+ messages in thread
From: Luis R. Rodriguez @ 2015-12-17 22:11 UTC (permalink / raw)
  To: cocci

On Thu, Dec 17, 2015 at 06:28:42PM +0100, Julia Lawall wrote:
> On Thu, 17 Dec 2015, Dharmalingam Ganesan wrote:
> 
> >
> > Hi,
> >
> > Coccinelle sounds very interesting. I?m curious whether you can comment on
> > any other tools for other programming languages.
> 
> Coccinelle doesn't support any languages other than C, and a small amount
> of C++.  For C++, it parses the C-like parts of the code, and ignores the
> rest.  It could be conceptually possible to design a version of Coccinelle
> for other languages, but it would require a lot of development work, so
> funding would be required.

And if you ask me, anyone not funding such endeavours, are simply insane,
considering all the gains on the C projects coccinelle has already impacted in
so many ways, not just for collateral evolutions, lately backporting, and
others.

 Luis

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Cocci] Coccinelle for other programming languages
  2015-12-17 17:28 ` Julia Lawall
  2015-12-17 22:11   ` Luis R. Rodriguez
@ 2015-12-18  8:00   ` SF Markus Elfring
  1 sibling, 0 replies; 12+ messages in thread
From: SF Markus Elfring @ 2015-12-18  8:00 UTC (permalink / raw)
  To: cocci

>> I?m curious whether you can comment on any other tools for other programming languages.

How do you think about to take another look at issues like the following?


> Coccinelle doesn't support any languages other than C, and a small amount of C++.

Support C++ codebases
https://github.com/coccinelle/coccinelle/issues/1

How many design elements can be shared for programming languages
which have got similar properties?
https://en.wikipedia.org/wiki/Procedural_programming


> For C++, it parses the C-like parts of the code, and ignores the rest.

Exclusion of unsupported source code parts
https://github.com/coccinelle/coccinelle/issues/20


> It could be conceptually possible to design a version of Coccinelle
> for other languages, but it would require a lot of development work,
> so funding would be required.

Class libraries for software components
https://github.com/coccinelle/coccinelle/issues/22

Regards,
Markus

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Cocci] Coccinelle for other programming languages
  2015-12-17 22:11   ` Luis R. Rodriguez
@ 2015-12-18  8:09     ` SF Markus Elfring
  2015-12-18 14:52       ` Dharmalingam Ganesan
  0 siblings, 1 reply; 12+ messages in thread
From: SF Markus Elfring @ 2015-12-18  8:09 UTC (permalink / raw)
  To: cocci

>> It could be conceptually possible to design a version of Coccinelle
>> for other languages, but it would require a lot of development work,
>> so funding would be required.
> 
> And if you ask me, anyone not funding such endeavours, are simply insane,

Have you got any contacts to contributors who could improve the financial
situation (and other resources) in meaningful ways?


> considering all the gains on the C projects coccinelle has already impacted
> in so many ways, not just for collateral evolutions, lately backporting,
> and others.

Would you like to start "drumming" any more for corresponding improvements?

Regards,
Markus

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Cocci] Coccinelle for other programming languages
  2015-12-18  8:09     ` SF Markus Elfring
@ 2015-12-18 14:52       ` Dharmalingam Ganesan
  2015-12-18 15:11         ` Julia Lawall
  2015-12-19  8:12         ` SF Markus Elfring
  0 siblings, 2 replies; 12+ messages in thread
From: Dharmalingam Ganesan @ 2015-12-18 14:52 UTC (permalink / raw)
  To: cocci

Hi,

What is the effort it will take to come up with a Coccinelle for dynamic languages such as Python, JavaScript, etc.

Which parts of Coccinelle would require customization, rework, etc.

Best regards,
Dharma

-----Original Message-----
From: SF Markus Elfring [mailto:elfring at users.sourceforge.net] 
Sent: Friday, December 18, 2015 3:10 AM
To: Luis R. Rodriguez
Cc: cocci at systeme.lip6.fr; Dharmalingam Ganesan
Subject: Re: [Cocci] Coccinelle for other programming languages

>> It could be conceptually possible to design a version of Coccinelle 
>> for other languages, but it would require a lot of development work, 
>> so funding would be required.
> 
> And if you ask me, anyone not funding such endeavours, are simply 
> insane,

Have you got any contacts to contributors who could improve the financial situation (and other resources) in meaningful ways?


> considering all the gains on the C projects coccinelle has already 
> impacted in so many ways, not just for collateral evolutions, lately 
> backporting, and others.

Would you like to start "drumming" any more for corresponding improvements?

Regards,
Markus

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Cocci] Coccinelle for other programming languages
  2015-12-18 14:52       ` Dharmalingam Ganesan
@ 2015-12-18 15:11         ` Julia Lawall
  2015-12-18 16:28           ` Dharmalingam Ganesan
  2015-12-19  8:12         ` SF Markus Elfring
  1 sibling, 1 reply; 12+ messages in thread
From: Julia Lawall @ 2015-12-18 15:11 UTC (permalink / raw)
  To: cocci

On Fri, 18 Dec 2015, Dharmalingam Ganesan wrote:

> Hi,
>
> What is the effort it will take to come up with a Coccinelle for dynamic
> languages such as Python, JavaScript, etc.
>
> Which parts of Coccinelle would require customization, rework, etc.

Pretty much everything.  The whole thing is built on an abstract syntax
tree (embedded into a control-flow graph), so almost all of the code is
determined by the various productions of the abstract syntax tree.  Of
course, many kinds of syntax found in C have counterparts in other
languages, so the work would mostly be tedious rather than hard.

Working on a dynamic language shouldn't make that much difference.  There
will just be no types; types have turned out to be often useful when
working on the Linux kernel.

Finally, interprocedural analysis with Coccinelle is somewhat awkward.
This hasn't been too much of an issue for the Linux kernel, where most of
the functions are large, but it could be a problem for other programming
styles.

julia

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Cocci] Coccinelle for other programming languages
  2015-12-18 15:11         ` Julia Lawall
@ 2015-12-18 16:28           ` Dharmalingam Ganesan
  2015-12-18 16:46             ` Julia Lawall
  0 siblings, 1 reply; 12+ messages in thread
From: Dharmalingam Ganesan @ 2015-12-18 16:28 UTC (permalink / raw)
  To: cocci

Thanks for the quick response. I'm watching your youtube videos. 

I saw " She develops the tool Coccinelle and has over 1000 patches in the Linux kernel based on this work". 

Is it possible to get access to all your patches? I went over the Coccinelle web page gallery, but not sure it has 1000 patches.

Thanks,
Dharma

-----Original Message-----
From: Julia Lawall [mailto:julia.lawall at lip6.fr] 
Sent: Friday, December 18, 2015 10:11 AM
To: Dharmalingam Ganesan
Cc: SF Markus Elfring; Luis R. Rodriguez; cocci at systeme.lip6.fr
Subject: Re: [Cocci] Coccinelle for other programming languages

On Fri, 18 Dec 2015, Dharmalingam Ganesan wrote:

> Hi,
>
> What is the effort it will take to come up with a Coccinelle for 
> dynamic languages such as Python, JavaScript, etc.
>
> Which parts of Coccinelle would require customization, rework, etc.

Pretty much everything.  The whole thing is built on an abstract syntax tree (embedded into a control-flow graph), so almost all of the code is determined by the various productions of the abstract syntax tree.  Of course, many kinds of syntax found in C have counterparts in other languages, so the work would mostly be tedious rather than hard.

Working on a dynamic language shouldn't make that much difference.  There will just be no types; types have turned out to be often useful when working on the Linux kernel.

Finally, interprocedural analysis with Coccinelle is somewhat awkward.
This hasn't been too much of an issue for the Linux kernel, where most of the functions are large, but it could be a problem for other programming styles.

julia

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Cocci] Coccinelle for other programming languages
  2015-12-18 16:28           ` Dharmalingam Ganesan
@ 2015-12-18 16:46             ` Julia Lawall
  2015-12-18 17:53               ` Dharmalingam Ganesan
  0 siblings, 1 reply; 12+ messages in thread
From: Julia Lawall @ 2015-12-18 16:46 UTC (permalink / raw)
  To: cocci



On Fri, 18 Dec 2015, Dharmalingam Ganesan wrote:

> Thanks for the quick response. I'm watching your youtube videos.
>
> I saw " She develops the tool Coccinelle and has over 1000 patches in the Linux kernel based on this work".
>
> Is it possible to get access to all your patches? I went over the Coccinelle web page gallery, but not sure it has 1000 patches.

https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/?id=refs%2Ftags%2Fnext-20151218&qt=author&q=Lawall

julia

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Cocci] Coccinelle for other programming languages
  2015-12-18 16:46             ` Julia Lawall
@ 2015-12-18 17:53               ` Dharmalingam Ganesan
  2015-12-18 18:11                 ` Julia Lawall
  0 siblings, 1 reply; 12+ messages in thread
From: Dharmalingam Ganesan @ 2015-12-18 17:53 UTC (permalink / raw)
  To: cocci

Hi,

Thanks a  lot.

I tried to run the attached cocci script on the attached C file. We got an error.

Not sure whether the cocci files under the script directory are for the users to try or for other programs.

Any comments?
Dharma 

-----Original Message-----
From: Julia Lawall [mailto:julia.lawall at lip6.fr] 
Sent: Friday, December 18, 2015 11:46 AM
To: Dharmalingam Ganesan
Cc: SF Markus Elfring; Luis R. Rodriguez; cocci at systeme.lip6.fr
Subject: RE: [Cocci] Coccinelle for other programming languages



On Fri, 18 Dec 2015, Dharmalingam Ganesan wrote:

> Thanks for the quick response. I'm watching your youtube videos.
>
> I saw " She develops the tool Coccinelle and has over 1000 patches in the Linux kernel based on this work".
>
> Is it possible to get access to all your patches? I went over the Coccinelle web page gallery, but not sure it has 1000 patches.

http://cp.mcafee.com/d/5fHCNESyM_txYsyYUrKrjKYyYMM-yCrjKYyYMM-UOrjKYyYMM-yMrjKYCVtxdVcSwhS7QS0atInlgVJl3LgrdKSbGEsSGxTEdCQn7Cm1Pz_nV55Mse78ZuVtddNzAS3hOO-CqeumKzp55mWbDaxVZicHs3jq9J4TvC7Amm7HKfcCXCOsVHkiP2cFYl-cffU03w2jM-k6M_2LNxV-4pjO7xYYfB1IfbMYfDN6kYfGhMB90WfKQ7FyYZ8Q7FyYf3VBQXELEFELd2QPJrCjH5Eme2KCdffdybpYJU_j6DDwE-iPDeNdFTsodwIqid41Fr4GSJ8QKCy0iHqQEuuvVEwtH4QglCj-9Ewmzkz7llpg8Cy0_o4mZ8_gS-Mrk49dAp-C

julia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshot __spatch -cocci_file notand.cocci notand.c__.png
Type: image/png
Size: 112518 bytes
Desc: screenshot __spatch -cocci_file notand.cocci notand.c__.png
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20151218/b2a36fdb/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot __notand.c__.png
Type: image/png
Size: 69170 bytes
Desc: Screenshot __notand.c__.png
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20151218/b2a36fdb/attachment-0003.png>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Cocci] Coccinelle for other programming languages
  2015-12-18 17:53               ` Dharmalingam Ganesan
@ 2015-12-18 18:11                 ` Julia Lawall
  0 siblings, 0 replies; 12+ messages in thread
From: Julia Lawall @ 2015-12-18 18:11 UTC (permalink / raw)
  To: cocci

> I tried to run the attached cocci script on the attached C file. We got
> an error.
>
> Not sure whether the cocci files under the script directory are for the
> users to try or for other programs.

Please don't send screen shots.  They are voluminous...  Coccinelle just
uses text, so you can just copy-paste the output into your message.

The scripts in the Linux kernel are designed to be used with the
coccicheck make target of the Linux kernel.  This is described in the
Linux kernel documentation in Documentation/coccinelle.txt.  But they can
also be used "by hand".  You can look for the "virtual" declarations at
the top of the semantic patch file, and use command line arguments to
select the kind of output you want.  For example, if the semantic patch
starts with virtual patch, then you can use -D patch on the command line
to get patch output.  Or if there is virtual report (which there should be
in all cases), you can use -D report.

If you are writing your own semantic patch, there is typically no need for
these virtual declarations.

You may find eg the demos directory of the Coccinelle source tree easier
to start looking at.  A number of examples are also available here:

http://coccinelle.lip6.fr/rules/

You can also look at https://btrlinux.inria.fr/category/coccinelle/ for
some examples of patches using Coccinelle.

julia

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Cocci] Coccinelle for other programming languages
  2015-12-18 14:52       ` Dharmalingam Ganesan
  2015-12-18 15:11         ` Julia Lawall
@ 2015-12-19  8:12         ` SF Markus Elfring
  1 sibling, 0 replies; 12+ messages in thread
From: SF Markus Elfring @ 2015-12-19  8:12 UTC (permalink / raw)
  To: cocci

> What is the effort it will take to come up with a Coccinelle for dynamic languages
> such as Python, JavaScript, etc.

Would you like to improve any software design elements from compiler technology
like the following?

1. Token stream
2. Abstract syntax tree
3. Control flow graph


> Which parts of Coccinelle would require customization, rework, etc.

Which impression do you get from corresponding open issues?

How do you think about to bring software developments forward around
computation tree logic?

Regards,
Markus

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-12-19  8:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-17 16:38 [Cocci] Coccinelle for other programming languages Dharmalingam Ganesan
2015-12-17 17:28 ` Julia Lawall
2015-12-17 22:11   ` Luis R. Rodriguez
2015-12-18  8:09     ` SF Markus Elfring
2015-12-18 14:52       ` Dharmalingam Ganesan
2015-12-18 15:11         ` Julia Lawall
2015-12-18 16:28           ` Dharmalingam Ganesan
2015-12-18 16:46             ` Julia Lawall
2015-12-18 17:53               ` Dharmalingam Ganesan
2015-12-18 18:11                 ` Julia Lawall
2015-12-19  8:12         ` SF Markus Elfring
2015-12-18  8:00   ` SF Markus Elfring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.