GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - sqlc-dev/darkwing

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
ast
ast
 
 
cmd
cmd
 
 
internal
internal
 
 
lexer
lexer
 
 
parser
parser
 
 
token
token
 
 
.gitignore
.gitignore
 
 
CLAUDE.md
CLAUDE.md
 
 
LICENSE
LICENSE
 
 
LICENSE.DUCKDB
LICENSE.DUCKDB
 
 
PLAN.md
PLAN.md
 
 
README.md
README.md
 
 
go.mod
go.mod
 
 

Repository files navigation

darkwing

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.

Status

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:

  • Accept/reject — darkwing accepts a statement iff the pinned binary parses it (TestCorpus), including transformer-raised parser errors.
  • Error fidelity — every rejection renders the oracle's error message verbatim (TestCorpusErrorMessages), with positions pinned by unit tests.
  • Tree shape — internal/serialize output matches vendored json_serialize_sql goldens for the SELECT subset (TestSerializeGoldens), with AST snapshots covering the rest.

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'

License

MIT (see LICENSE). Vendored DuckDB grammar files and the ported engine derive from MIT-licensed DuckDB source; see LICENSE.DUCKDB.

About

No description, website, or topics provided.

Resources

Readme
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.