Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Origin preservation #21

Open
7 tasks
Virtlink opened this issue Jun 18, 2020 · 0 comments
Open
7 tasks

Origin preservation #21

Virtlink opened this issue Jun 18, 2020 · 0 comments
Assignees

Comments

@Virtlink
Copy link
Contributor

Origin tracking allows to see the original (source) terms a transformed term belongs to. This is used, for example, to put error messages in the source code. Origin tracking/preservation in Stratego and Spoofax is currently broken: origins are only preserved for the all, some, and one built-in Stratego strategies.

This issue tracks work on fixing origin preservation.

  • Implement performance benchmarks for Stratego
  • Measure current Stratego performance
  • Implement origin tracking in main ITermFactory implementation Add buildX methods to ITermFactory that preserve the origin of the replaced term #20
  • Write tests for origin tracking in main ITermFactory implementation
  • Change Stratego compiler to generate code to call the new ITermFactory origin preserving methods
  • Measure new Stratego performance
  • Fix any performance regressions

@Apanatshka outlines the background and ideas here. In its essence, it boils down to implementing origin preservation (that is, copy the origin of a source term instead of taking the source term as the origin, as in origin tracking) by taking the origin of the input term when building a new term (!C()). In many situations, such as congruences, rules, and where-clauses, the Stratego code is desugared down to basic Stratego match and build strategies. Origin tracking on terms build is expected to solve 90% of origin preservation problems, but might have some implications on performance and effects on compiler optimizations.

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

No branches or pull requests

2 participants