Rethink how names are given to compiler-generated closures
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
The heuristic used to name compiler-generated closures like `foo@376` and `clo43@53` is weak. In general the compiler tries to use a related name, e.g. the `let` identifier being bound, plus the source line number. The source line number seems to be useful, though we could perhaps use `@line365` or similar.
The main problem appears to be with the name portion. I need to collect specific micro samples but some things I've noticed are
* Unnecessary use of the backup name `clo`
* Sometimes other compiler-generated names are used as the basis for the name. In debug code I've even seen closure names like `Pipe input at line 63@53` recently after the addition of pipeline debugging and I think some are appearing in our codegen tests for queries
Anyway, we can surely have a better heuristic where useful names are always given.
Contributor guide
Assessment
This issue has not been assessed yet.