FREEDOM251

Freedom251 › Compare

Side by side

ast-grep vs Coccinelle

Both stand on code refactoring tools. Which one you can start free with, which one lets you read the code, and what each costs once you pay.

ast-grep

Free plan APIExtensionLinux+3

ast-grep combines structural code search, configurable linting, and rewriting in a free, open-source tool. Its language coverage and integrations are broad, though it does not provide some advanced static-analysis information and rules are limited to one language at a time.

Visit ast-grep

Coccinelle

Free plan LinuxMac

Coccinelle focuses on repository-wide matching and transformations expressed as semantic patches. It is free, but source builds have prerequisites and C++ support is still being extended.

Visit Coccinelle

The facts

ast-grepCoccinelle
Free planYesYes
Open sourceNot publishedNot published
Runs onAPI, Extension, Linux, Mac, Web, WindowsLinux, Mac
Lowest paid planFree or on requestFree or on request
Plans published11
MakerNot publishedNot published
Websiteast-grep.github.iococcinelle.gitlabpages.inria.fr
On code refactoring tools#1 of 22#4 of 22

ast-grep: what it does well

  • Searches and rewrites code by syntax-tree pattern.
  • Interactive CLI previews rewrites before applying them.
  • Supports 20+ languages and custom language loading.
  • Rule tests can use snapshots.
  • Online playground works without local installation.

What to know first

  • Some advanced static-analysis information is unsupported.
  • A rule cannot target multiple languages at once.

Coccinelle: what it does well

  • Semantic patches can update many files and code sites.
  • Handles variation in spacing, names and coding style.
  • Semantic patches and bug fixes are integrated into Linux.
  • Free, with source and precompiled spatch builds available.
  • Documentation includes grammar, examples and an introductory lecture.

What to know first

  • Available for Linux and macOS only.
  • Building from source requires OCaml.
  • Python and Menhir are needed in certain build situations.

Alternatives to ast-grep Alternatives to Coccinelle The whole list