Powderworks: No more forking Tree-sitter grammars

Powderworks

3 min read Original article ↗

Powderworks provides professionally maintained, well-tested Tree-sitter compatible Wasm grammars for security and code analysis, with comprehensive coverage of all the languages you care about.

The Tree-sitter ecosystem is great for editors. Its grammars are fast, incremental, and forgiving: they keep highlighting while you type and patch over code they don't understand. Static analysis needs something else. A SAST tool has to read every file the way the language's own tooling does, in the language version the project actually uses, and a grammar that patches or skips over code it doesn't understand means missed findings and false alarms.

So teams fork. When a grammar doesn't know a new syntax or a dialect your customers write, you patch your own copy and wait, hoping that the next upstream release will happen sometime this year and address your issue. Our goal is to end the forking: grammars for every programming language, for every version and dialect of each, all continually updated, maintained, and tested.

Our grammars are Tree-sitter compatible WebAssembly modules. They load into web-tree-sitter like any other grammar, and your queries, cursors, and bindings work just as they do with grammars Tree-sitter generates. They're the same parsers that power Ur.

Try one for free: download the Python 3.12 grammar, rebuilt every night. This code runs it in Node or a browser:

import { Language, Parser } from 'web-tree-sitter';

await Parser.init();
const grammar = await fetch('https://ur.dev/samples/ur_python_3_12.wasm');
const python = await Language.load(new Uint8Array(await grammar.arrayBuffer()));
const parser = new Parser();
parser.setLanguage(python);
console.log(parser.parse('print("hello")\n').rootNode.toString());

One grammar per version

The same line of code can be valid in one version of a language and an error in the next. Our Python 2.7, 3.8, and 3.12 grammars read these three lines differently:

Code2.73.83.12
print "hello"✅ErrorError
if (n := 10) > 5: passError✅✅
match command: case _: passErrorError✅

A single grammar for every version gets some of these wrong whichever version your project uses, and the scanner, linter, or migration tool built on it misreads your code. Pick the grammar for the version you target: it parses what that version parses, and returns a file the version rejects as one parse error, not a guessed tree. Dialects work the same way: PostgreSQL's DISTINCT ON parses in our PostgreSQL grammars and fails in our MySQL grammars.

Tested and maintained

We test each grammar against its language's reference parser on large real-world codebases, and check each Tree-sitter grammar against Ur's own trees, node for node. We maintain them continuously and fix the bugs you report promptly. Every grammar must parse all the real-world code we test it on, node for node and field for field.

Languages, versions, and dialects

We currently offer 101 grammars across 18 languages. Each version or dialect is a grammar of its own, named for it: python-3.12 loads as ur_python_3_12.wasm.

LanguageDialectGrammars
CGNUc-89c-99c-11c-17c-23
C++GNUcpp-98cpp-11cpp-14cpp-17cpp-20cpp-23
GoGcgo-1.0go-1.9go-1.13go-1.18go-1.24go-1.27
JavaJavacjava-8java-11java-17java-21java-25java-27
JavaScriptJavaScriptecmascript-2025ecmascript-2025-jsx
TypeScriptTypeScripttypescript-5.9typescript-5.9-experimental-decoratorstypescript-5.9-jsxtypescript-5.9-experimental-decorators-jsx
JinjaJinja2jinja-3.1
Dbtjinja-dbt-3.1
LeanLean4lean-4
MarkdownGFMmarkdown-0.31
PHPZendphp-7.4php-8.0php-8.1php-8.2php-8.3php-8.4php-8.5
PythonCPythonpython-2.7python-3.7python-3.8python-3.9python-3.10python-3.11python-3.12python-3.13python-3.14python-3.15
FuturePrintFunctionpython-2.7-print-function
UrscalUrurscal-1
RubyCRubyruby-3.3ruby-3.4ruby-4.0
RustRustcrust-2015rust-2018rust-2021rust-2024
ShellPOSIXshell-posix-2008shell-posix-2024
Bashshell-bash-3.2shell-bash-4.0shell-bash-4.1shell-bash-4.2shell-bash-4.3shell-bash-4.4shell-bash-5.0shell-bash-5.1shell-bash-5.2shell-bash-5.3
Kshshell-ksh-88shell-ksh-93
Zshshell-zsh-5.9
SQLANSIsql-ansisql-ansi-jinja
SQLitesql-sqlite-3
MySQLsql-mysql-5.7sql-mysql-8.4sql-mysql-9.7sql-mysql-26.7
PostgreSQLsql-postgres-14sql-postgres-15sql-postgres-16sql-postgres-17sql-postgres-18sql-postgres-14-jinjasql-postgres-15-jinjasql-postgres-16-jinjasql-postgres-17-jinjasql-postgres-18-jinja
SparkSQLsql-sparksql-3.5sql-sparksql-4.0sql-sparksql-4.1sql-sparksql-4.2
ClickHousesql-clickhouse-25.8sql-clickhouse-26.9
BigQuerysql-bigquery-2024.11
TLA+SANYtlaplus-2
TOMLTOMLtoml-1.0toml-1.1

Pricing

Every license is perpetual: you keep the releases it covers, and each release includes every grammar in the table above. We're always adding grammars and dialects, and making every grammar more accurate and faster.

Monthly

$2,500 per month

  • A perpetual license to every release published that month
  • Support by email and Slack

Annual

$25,000 per year

  • A perpetual license to every release published that year
  • Support by email and Slack
  • Twelve months for the price of ten

Enterprise

Contact us

  • Enterprise support
  • Your languages first: tell us which grammars you need, and we build them

We're working through a list of languages to support next, and enterprise customers' requests go to the front of it. For a license, enterprise support, or anything else, email info@powderworks.dev.