Skip to content

Commit c8cd08e

Browse files
JuliaLawallojeda
authored andcommitted
Add "Coccinelle for Rust" page
Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 88605ef commit c8cd08e

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
## Tools
2424

25+
- [Coccinelle for Rust](Coccinelle-for-Rust.md)
26+
2527
## Users
2628

2729
- [NVMe Driver](NVMe-driver.md)

src/Coccinelle-for-Rust.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Coccinelle for Rust
2+
3+
Coccinelle is a tool for automatic program matching and transformation that
4+
was originally developed for making large scale changes to the Linux kernel
5+
source code (ie, C code). Matches and transformations are driven by
6+
user-specific transformation rules having the form of abstracted patches,
7+
referred to as semantic patches. As the Linux kernel, and systems software
8+
more generally, is starting to adopt Rust, we are developing Coccinelle for
9+
Rust, to make the power of Coccinelle available to Rust codebases.
10+
11+
## Examples
12+
13+
Changing a method call sequence in the Rust implementation:
14+
15+
![Changing a method call sequence in the Rust implementation](Coccinelle-for-Rust/tcx.png)
16+
17+
Merging some lifetimes in tokio:
18+
19+
![Merging some lifetimes in tokio](Coccinelle-for-Rust/tokio.png)
20+
21+
## Current status
22+
23+
Coccinelle for Rust is currently a prototype. It relies on Rust Analyzer
24+
for parsing and rustfmt for pretty printing. It mainly supports matching
25+
and transformation of expressions and types, but reasoning about control
26+
flow is not yet supported.
27+
28+
## Availability
29+
30+
[Coccinelle for Rust](https://gitlab.inria.fr/coccinelle/coccinelleforrust.git)
31+
32+
[A recent talk about Coccinelle for Rust](https://gitlab.inria.fr/coccinelle/coccinelleforrust/-/blob/main/talks/rfl.pdf)
33+
34+
## Contact
35+
36+
- Julia Lawall: [[email protected]](mailto:[email protected])
37+
- Tathagata Roy: [[email protected]](mailto:[email protected])

src/Coccinelle-for-Rust/tcx.png

14 KB
Loading

src/Coccinelle-for-Rust/tokio.png

11.2 KB
Loading

0 commit comments

Comments
 (0)