Piranha: Building a Multilingual Deadcode Deletion Bot
summary
Piranha is an AST‑based code‑deletion bot that runs in a pipeline and generates diffs for stale feature flags it detects via flag metadata and a tracker it integrates with Fabricator The system deletes 350K LoC deleted across mobile Java Swift Objective C, removes 5,500 stale flags, and produces small diffs reviewers process in about 16 minutes on average Heuristics prove correct ~80% of the time and a rearchitecture builds Polyglot Piranha with language‑specific rewrite rules and a chained rewrite engine hosted on GitHub
AI-written summary · about
chapters (9)
- 0:00Introduction to Piranha
- 3:36Feature flags explained
- 9:12Stale feature flags problem
- 13:24Piranha bot overview
- 21:30Key learnings from Piranha
- 23:20Polyglot Piranha introduction
- 26:12Cleanup rules and rewrites
- 30:49Polyglot Piranha usage
- 33:16Piranha timeline and future
related talks
19mA Lightweight Polyglot Code Transformation Language
25mHow we automated code maintenance
12mHow we automated code maintenance
38mDeleting Code Is Hard And You Should Do It
35mKill your Dead Code with Fire!
27mThe art of deleting code
30mDead Code Shouldn't Exist
36mCode as Data: How data insights on legacy codebases fill the knowledge gap in modernization projects
