| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
The terror that flaps in the night, for DuckDB.
darkwing is a hand-written, zero-dependency Go port of DuckDB v2.0's PEG-based SQL parser, built to power a first-class DuckDB engine in sqlc. See PLAN.md for the full design.
Unlike its siblings (oliphant, marino, meyer, teesql, zetajones, doubleclick), darkwing does not re-express the grammar as recursive descent: DuckDB's own production parser is an interpreter over machine-readable grammar text, so darkwing vendors the .gram/.list files verbatim and ports the engine — tokenizer, grammar loader, and matcher (with packrat memoization) — to Go.
Milestones 1–6 are complete: the engine (tokenizer, grammar loader, matcher with packrat memoization), the corpus conformance gates, the full typed AST with a transformer for every statement, and the hardening pass. go test ./parser enforces, corpus-wide against the pinned DuckDB CLI:
Hardening: FuzzParse holds the public API to its invariants on arbitrary input, benchmarks pin parse throughput and upstream's pathological-backtracking case (19 unmatched parens: milliseconds, thanks to packrat), and cmd/difftest mutates corpus seeds and diffs darkwing's verdicts against the pinned CLI (run nightly in CI while the nightly artifact matches the pin).
Next: advancing the pin to the v2.0.0 tag when it lands (milestone 7), then sqlc integration.
$ go run ./cmd/debug-parse 'SELECT 1' $ go run ./cmd/debug-parse -tokens 'SELECT * FROM t' $ go run ./cmd/debug-parse -ast 'FROM t SELECT x'
MIT (see LICENSE). Vendored DuckDB grammar files and the ported engine derive from MIT-licensed DuckDB source; see LICENSE.DUCKDB.
| Back | FazBrowse Home | New Git URL |