Skip to content

Research exhaustiveness linters and profile the Rust build - #1866

Merged
JacobStephens2 merged 1 commit into
mainfrom
research-language-followups
Nov 9, 2026
Merged

JacobStephens2 merged 1 commit into
mainfrom
research-language-followups

Conversation

@JacobStephens2

Copy link
Copy Markdown
Owner

Summary

Two research notes following the Go (#1835) and TypeScript (#1840) comparisons with the Rust binary. ADR-0001 is unchanged.

 docs/research/
 ├── go-vs-rust-prototype.md
 ├── typescript-vs-rust.md
+├── exhaustiveness-linters.md   # do ready-made linters replace Go's custom checker and TS's `satisfies never`?
+└── rust-build-profile.md       # where the Rust build's time goes
  • Exhaustiveness linters: with explicit configuration, Go's exhaustive and typescript-eslint's switch-exhaustiveness-check make a new variant fail CI at every unhandled switch. That's roughly what Rust's match plus clippy::wildcard_enum_match_arm gives here. Go's exhaustive reproduces the prototype's 129-line custom checker. Rust still differs in three ways: its missing-case check is unconditional, its variants carry payloads, and safe code can't hold an invalid value. Go keeps the largest gap.
  • Rust build profile:
    • A cold dev build takes 65.6 s on 4 vCPUs, and about 30 s of that waits on aws-lc-sys (rustls's C crypto). The thirdshift crate itself takes 29 s.
    • A rebuild after an edit takes about 8 s, of which cargo check accounts for 2 s.
    • A slice-only library would save little on cold builds. The slice also imports about 40 other modules, so splitting it out would mean decoupling production code.

Related: #1865 (derive the Console's OpenAPI response schemas from the Rust types), which came out of the same review.

Evidence

Execution evidence

Documentation only; no code or tests change.

  • Exhaustiveness: exhaustive v0.17.1, go-check-sumtype v0.5.0, golangci-lint v2.15.0, ESLint 9.39.5 with typescript-eslint 8.72.2, and tsc 5.9.3. They ran against scratch copies of prototype/go and prototypes/typescript, including copies with a variant added (ciCancelled, closed). The note separates what was run from what was read in the cited sources.
  • Build profile: cargo build --locked --bin thirdshift --timings from an empty target directory at 6c26e8d9, in the Lima VM, then two edit-and-rebuild runs each with cargo build and cargo check. Per-unit times come from the timing report's UNIT_DATA.

Merge Danger

Door: two-way

Blast Radius: none. Two new Markdown files under docs/research/.

Follow-ups to the Go (#1835) and TypeScript (#1840) comparisons.
@JacobStephens2
JacobStephens2 merged commit 82f88ec into main Nov 9, 2026
4 checks passed
@JacobStephens2
JacobStephens2 deleted the research-language-followups branch November 9, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant