Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Oct 23, 2024

Use BoundIdentifier::create_binding_pattern, rather than writing out the code to create a BindingPattern manually each time.

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 23, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added the A-transformer Area - Transformer / Transpiler label Oct 23, 2024
Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @overlookmotel and the rest of your teammates on Graphite Graphite

@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Oct 23, 2024
@overlookmotel overlookmotel marked this pull request as ready for review October 23, 2024 10:37
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 23, 2024

CodSpeed Performance Report

Merging #6809 will not alter performance

Comparing 10-23-refactor_transformer_shorten_code (b8dfa19) with main (e59b5d9)

Summary

✅ 30 untouched benchmarks

@overlookmotel overlookmotel requested a review from Dunqing October 23, 2024 10:42
Copy link
Member

@Dunqing Dunqing left a comment

Choose a reason for hiding this comment

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

I have to say the BoundIdentifier is so great!

@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Oct 23, 2024
Copy link
Member

Dunqing commented Oct 23, 2024

Merge activity

  • Oct 23, 9:11 AM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Oct 23, 9:11 AM EDT: A user added this pull request to the Graphite merge queue.
  • Oct 23, 9:25 AM EDT: A user merged this pull request with the Graphite merge queue.

Use `BoundIdentifier::create_binding_pattern`, rather than writing out the code to create a `BindingPattern` manually each time.
@Dunqing Dunqing force-pushed the 10-23-refactor_transformer_shorten_code branch from 2ea8513 to b8dfa19 Compare October 23, 2024 13:18
@overlookmotel
Copy link
Member Author

I have to say the BoundIdentifier is so great!

I still think we can improve the API. I would prefer methods on the AST types e.g. BindingIdentifier::from_binding(binding, ctx), BindingPattern::from_binding(binding, ctx). But at least BoundIdentifier removes boilerplate code for things we do commonly.

@graphite-app graphite-app bot merged commit b8dfa19 into main Oct 23, 2024
@graphite-app graphite-app bot deleted the 10-23-refactor_transformer_shorten_code branch October 23, 2024 13:25
@Dunqing
Copy link
Member

Dunqing commented Oct 23, 2024

I still think we can improve the API. I would prefer methods on the AST types e.g. BindingIdentifier::from_binding(binding, ctx), BindingPattern::from_binding(binding, ctx). But at least BoundIdentifier removes boilerplate code for things we do commonly.

Yes, that would be better, but unfortunately, we can't get the Atom from SymbolTable::get_name, this may incur additional performance overhead.

@overlookmotel
Copy link
Member Author

Yes, that would be better, but unfortunately, we can't get the Atom from SymbolTable::get_name, this may incur additional performance overhead.

Yeah we need to switch Semantic from storing names as CompactStrs to Atoms. That'd be a significant perf boost, and make lots of other things simpler. The blocker on that is that it makes SymbolTable need a lifetime SymbolTable<'a>, and apparently that causes problems for Rolldown (though I don't understand why).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue A-transformer Area - Transformer / Transpiler C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants