PolyglotPiranha vs Spoon
PolyglotPiranha
github.comSpoon
spoon.gforge.inria.frSide by side
| Figure | PolyglotPiranha | Spoon |
|---|---|---|
| Price from | — | Free |
| Free plan | — | Yes |
| Free trial | — | — |
| Open source | — | — |
| macOS | Yes | — |
| Linux | Yes | Yes |
| iOS | Yes | — |
| API | Yes | Yes |
| Self-hosted | Yes | Yes |
| Plans published | 0 | 1 |
| Spec score · Code Refactoring Tools | 7.2 (#19) | 7.8 (#10) |
| Integrations | The Python wrapper is described as suitable for incorporation into pipelines; the documentation does not name specific CI or feature flag vendor integrations. | The site documents Maven and Gradle usage, along with command-line execution using a JAR from Maven Central. |
| License | Piranha is licensed under Apache 2.0. | Spoon is free and open source under the CeCILL-C and MIT licenses. |
| Purpose | Polyglot Piranha is a lightweight code transformation toolset for automating large scale changes and is used at Uber mostly to clean up stale feature flags. | Spoon is an open-source library for analyzing, rewriting, transforming, and transpiling Java source code. |
| Support | Users with questions or bug reports are directed to open a GitHub issue. | The site directs users seeking professional development, training, or extension support to comment on a GitHub issue. |
Plans
In their own words
PolyglotPiranha
PolyglotPiranha is a free, multilingual structural search-and-replace engine for code cleanup. It can refactor stale feature-flag code when given a flag name, expected behavior, and configured feature-flag API rules. Rules can form graphs, and built-in language-specific cleanups include simplifying boolean expressions and if-else statements, removing empty declarations and files, and inlining local variables. Queries and filters may use Tree-sitter queries, regular expressions, or Piranha’s concrete syntax. The project is available as a Python library and command-line tool, with the Python API wrapping the CLI. The CLI lists Java, Swift, Python, Kotlin, Go, TSX, and TypeScript as target languages. Dry runs prevent in-place rewriting and produce summaries of matches, rewrites, and resulting file content. API configuration requires code path, configuration path, target language, and substitutions, with optional rules.toml and edges.toml files. Python installation uses pip; the CLI can be built with Rust and Cargo or obtained from releases. Piranha is Apache 2.0, provided as is, and not an official Uber product.
Spoon
Spoon is a free, open-source library for analyzing, rewriting, transforming, and transpiling Java source code. It parses source files into an abstract syntax tree (AST), then exposes APIs for inspecting and changing that model. Processors can perform source-level static analysis on selected AST element types, while architectural rules can be expressed as AST checks and run as JUnit tests in continuous integration. Transformation facilities cover instrumentation and refactoring, including helpers for local and generic variables and removing deprecated methods. Spoon can also provide shared analysis of binary and source code through CtClass objects as an alternative to Java reflection. The project supports Java source up to Java 25, but runtime requirements vary: Spoon 11.x needs JDK 17 or later, 10.x needs JDK 11 or later, and 9.x needs Java 8. It is available through Java, the command line, Maven, and Gradle, with a dependency JAR on Maven Central. Command-line use requires manual classpath handling and source dependencies specified with --source-classpath. Spoon is an official Inria project and an OW2 consortium member.