Design the salsa db trait and SourceFile input skeleton #44

Closed
opened 2026-08-20 19:06:08 +00:00 by jacksonopp · 0 comments
Owner

The concrete #[salsa::db] database trait and #[salsa::input] shape for source files, decided before any query logic is written -- this is the part of #1 that's expensive to unwind later if the shape is wrong, since every future query signature (Step 2's checker, Step 9's LSP) depends on it.

Open questions to resolve here:

  • What does the Db trait look like, and does twill-check own it or does a future LSP crate compose it on top
  • Is SourceFile a single file or does it need to model a multi-file module graph from the start
  • Are parse (calling twill-parser) and lower (see the AST-lowering ticket) separate #[salsa::tracked] fns, so downstream queries can depend on lowering without re-running parse on unrelated edits

Follows from the two decisions already made in #1's discussion (real salsa; lower to an owned/interned tree before it crosses a query boundary).

The concrete #[salsa::db] database trait and #[salsa::input] shape for source files, decided before any query logic is written -- this is the part of #1 that's expensive to unwind later if the shape is wrong, since every future query signature (Step 2's checker, Step 9's LSP) depends on it. Open questions to resolve here: - What does the Db trait look like, and does twill-check own it or does a future LSP crate compose it on top - Is SourceFile a single file or does it need to model a multi-file module graph from the start - Are parse (calling twill-parser) and lower (see the AST-lowering ticket) separate #[salsa::tracked] fns, so downstream queries can depend on lowering without re-running parse on unrelated edits Follows from the two decisions already made in #1's discussion (real salsa; lower to an owned/interned tree before it crosses a query boundary).
jacksonopp added this to the twill project 2026-08-20 19:06:38 +00:00
jacksonopp removed this from the twill project 2026-10-04 02:28:22 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jacksonopp/twill#44
No description provided.