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

convert shape code to be visitor glue #1498

Closed
nikomatsakis opened this issue Jan 12, 2012 · 3 comments
Closed

convert shape code to be visitor glue #1498

nikomatsakis opened this issue Jan 12, 2012 · 3 comments
Assignees
Labels
A-codegen Area: Code generation A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot.
Milestone

Comments

@nikomatsakis
Copy link
Contributor

I would like to do away with the shape code and instead have the compiler generator "visitor glue", which is glue code that walks the data structure and invokes methods on a visitor. The methods would be encoded as a struct of functions. This could replace the logging, universal equality, and other functions of glue code. If it's fast enough, we may be able to replace the take, drop, and free glue with visitor glue, but if not, we could at least tie the code generation together so that they are all driven from the same codebase.

@pcwalton
Copy link
Contributor

pcwalton commented Sep 6, 2012

There are three facets to this: equality, logging, and cycle collection. For comparison, shape code is currently used only for != and pattern matching of strings. For logging and cycle collection, it's used everywhere.

The fix for comparison is to add ne to the Eq trait and to make pattern matching of strings call into a magic string comparison lang-item.

The fix for logging is to make logging call into a magic lang-item that uses the visitor glue. (It should eventually be a macro.)

The fix for cycle collection is to either replicate the cycle collector with visitor glue or to switch to a conservative garbage collector for @ boxes.

@nikomatsakis
Copy link
Contributor Author

Deferring to 0.5

@catamorphism
Copy link
Contributor

As far as I know, this is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot.
Projects
None yet
Development

No branches or pull requests

3 participants