Skip to content

Original farrow implementation - #201

Merged
boyland merged 8 commits into
boyland:masterfrom
amir734jj:user/amir734jj/original-farrow
Sep 7, 2026
Merged

Original farrow implementation#201
boyland merged 8 commits into
boyland:masterfrom
amir734jj:user/amir734jj/original-farrow

Conversation

@amir734jj

@amir734jj amir734jj commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary
This PR adds a synth-function evaluator based on the approach described in Farrow’s 1986 paper. It can be selected with -F0 or --synth-pure-farrow.

The evaluator generates a recursive function for each synthesized attribute. When it encounters a circular dependency, it evaluates the relevant dependency component repeatedly until its values stop changing.

What implementation supports:

  • inherited and synthesized attributes
  • circular attributes
  • circular collection attributes attached to syntax-tree nodes
  • local variables declared inside match rules
  • circular local variables
  • local collection variables
  • conditional assignments and case expressions
  • nested syntax-tree scopes
  • non-fiber SNC grammars, such as simple-snc

Current limitations
Fibers are not supported. Since APS represents module-level dependencies using fibers, this also means the evaluator does not currently support:

  • module-level global variables
  • global collections
  • circular global collections
  • remote or object-field dependencies that require fibers

@boyland boyland left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@amir734jj
amir734jj marked this pull request as ready for review September 3, 2026 02:39

@boyland boyland left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good changes

@boyland
boyland merged commit 304b65b into boyland:master Sep 7, 2026
1 check passed
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.

2 participants