Workshop ast-grep: deterministic control over your polyglot code base
Details
Keeping control of your polyglot codebase, while it grows and ages, can become increasingly difficult. And, using generative AI only makes it more difficult to keep in control.
Off-the-shelf linting / QA tools offer great deterministic guardrails to enforce conventions in your code base, but typically don’t offer a simple way to extend them with custom rules.
Also, performing searches on a codebase tends to be error-prone due to having to rely on regex, unexpected formatting differences, or the existence of comments. Moreover, migrating code often involves more than just a search & replace on your codebase, usually takes too long to do manually, or will simply burn too many tokens using LLM agent solutions like Clause Code or Codex.
Luckily, nowadays there are tools like ast-grep that act like a Swiss Army knife for your code. They offer a DIY (Do It Yourself) solution for linting (including autofix), structural search, and automated code migrations / rewrites (codemods). Being polyglot, they support many languages such as JavaScript, Java, Kotlin, Python, Bash, YAML, JSON, TypeScript, HTML, and CSS.
And, deterministic ast-grep linting could be used as a guardrails to keep your LLM agents in control, while ast-grep search & replace can significantly help reduce LLM token usage when performing large scale refactoring.
During the workshop, after a short presentation, you will get hands-on with ast-grep. At your own pace, through various exercises, you will learn enough to start using ast-grep proficiently in your day-to-day work.
