Skip to content

Enrich the query/transform algebra (rule composition, ellipsis, templates, strategies) #60

@konard

Description

@konard

Context

Issue #47's title demands "the richest features set" against all competitors.
The code-tooling survey (competitors-code-tooling.md)
identifies query/transform operators that competitors ship and meta-language
lacks. LinkQuery covers type/term/language/named/S-expressions/captures;
ReplacementRule/SubstitutionRule cover replace-and-substitute. See
requirements.md R-11 (extension) and
solution-plans.md S-12.

Scope

Operators to add over links (each with competitor provenance):

  • Relational, composable rule algebra: inside, has, precedes,
    follows, all/any/not, named reusable sub-rules (ast-grep).
  • Ellipsis (...) gap matching and kind-constrained (typed) metavariables
    (Semgrep, Coccinelle).
  • Grammar-less fallback matching over plain-text token links for unwired
    languages (Comby).
  • Quasiquote replacement templates with placeholder safety and
    parenthesization-conservative reprinting (Babel template, Recast).
  • Traversal-strategy combinators: topdown, bottomup, innermost,
    fixpoint (Stratego, Rascal).
  • A valid/invalid snapshot test harness for rules (ast-grep) so rule suites
    are self-verifying.

Acceptance criteria

  • Each operator has unit tests plus at least one parity fixture ported
    from the competitor that motivated it.
  • S-expression syntax extended (or a documented alternative added) so the
    new operators are reachable from text queries, not just builders.
  • Existing query/transform tests pass unchanged.
  • Changelog fragment added (bump: minor).

References


Filed from docs/case-studies/issue-47/proposed-issues/12-query-transform-algebra.md. Part of the implementation plan for #47.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions