All of lore.kernel.org
 help / color / mirror / Atom feed
* [cocci] How does Coccinelle call a script language from OCaml?
@ 2022-03-21 17:46 Eric Wheeler
  2022-03-21 18:30 ` Julia Lawall
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eric Wheeler @ 2022-03-21 17:46 UTC (permalink / raw)
  To: cocci

Hello,

I'm curious how easy it would be to add Perl, since that is my most 
comfortable scripting language.

Does Coccinelle dynamic-link directly to the python interpreter or 
is piping through |python ?

What source file(s) handle the script invocation?

--
Eric Wheeler

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

* Re: [cocci] How does Coccinelle call a script language from OCaml?
  2022-03-21 17:46 [cocci] How does Coccinelle call a script language from OCaml? Eric Wheeler
@ 2022-03-21 18:30 ` Julia Lawall
  2022-03-21 18:39 ` Markus Elfring
  2022-03-21 19:05 ` Markus Elfring
  2 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2022-03-21 18:30 UTC (permalink / raw)
  To: Eric Wheeler; +Cc: cocci, Thierry.Martinez



On Mon, 21 Mar 2022, Eric Wheeler wrote:

> Hello,
>
> I'm curious how easy it would be to add Perl, since that is my most
> comfortable scripting language.
>
> Does Coccinelle dynamic-link directly to the python interpreter or
> is piping through |python ?
>
> What source file(s) handle the script invocation?

If you want to add perl, I have no problem with that.  I think that the
Coccinelle part is in python/pycocci.ml.  But it relies on an existing
connection between OCaml and python.  If you don't have that, it would
probably be a lot more complex.

Thierry, who I added to the CC list, should be able to explain how exactly
OCaml interacts with python.

julia

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

* Re: [cocci] How does Coccinelle call a script language from OCaml?
  2022-03-21 17:46 [cocci] How does Coccinelle call a script language from OCaml? Eric Wheeler
  2022-03-21 18:30 ` Julia Lawall
@ 2022-03-21 18:39 ` Markus Elfring
  2022-03-21 19:05 ` Markus Elfring
  2 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2022-03-21 18:39 UTC (permalink / raw)
  To: Eric Wheeler; +Cc: cocci

> I'm curious how easy it would be to add Perl, since that is my most
> comfortable scripting language.


There are only a few hints available.

https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/20fdb67f4b20a242f222337e13091115884cf6bb/docs/manual/cocci_syntax.tex#L686
https://github.com/coccinelle/coccinelle/blob/ae337fce1512ff15aabc3ad5b6d2e537f97ab62a/docs/manual/cocci_syntax.tex#L686



> What source file(s) handle the script invocation?


Would you get further development ideas from another file?

https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/248a2742e76ceab620d67967a537fc5cb9282405/configure.ac#L278
https://github.com/coccinelle/coccinelle/blob/7cc8d6453a2f92ac13f458bcb496a17c79dafeaa/configure.ac#L278

Regards,
Markus


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

* Re: [cocci] How does Coccinelle call a script language from OCaml?
  2022-03-21 17:46 [cocci] How does Coccinelle call a script language from OCaml? Eric Wheeler
  2022-03-21 18:30 ` Julia Lawall
  2022-03-21 18:39 ` Markus Elfring
@ 2022-03-21 19:05 ` Markus Elfring
  2 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2022-03-21 19:05 UTC (permalink / raw)
  To: Eric Wheeler; +Cc: cocci, Thierry Martinez

> I'm curious how easy it would be to add Perl,


Corresponding development efforts depend on the level of system integration
that you would like to achieve.



> since that is my most comfortable scripting language.


Two scripting languages are directly supported by the Coccinelle software.

Various other programs can additionally be called according to your data processing needs,
can't they?
https://ocaml.org/api/Sys.html#VALcommand
https://docs.python.org/3/library/subprocess.html#popen-constructor

Regards,
Markus

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

end of thread, other threads:[~2022-03-21 19:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-21 17:46 [cocci] How does Coccinelle call a script language from OCaml? Eric Wheeler
2022-03-21 18:30 ` Julia Lawall
2022-03-21 18:39 ` Markus Elfring
2022-03-21 19:05 ` 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.