Conversation
spoenemann
reviewed
Apr 24, 2026
| type GeneratedSrv struct { | ||
| Lexer lexer.Lexer | ||
| Parser parser.Parser | ||
| SymbolContainers core.SymbolContainers |
Member
There was a problem hiding this comment.
Shouldn't this be just a function instead of an interface with a method?
Comparison:
srv.Generated().SymbolContainers.New()vs.
srv.Generated().NewSymbolContainer()
Member
Author
There was a problem hiding this comment.
I do like the interface more - but is just a preference. I feel like the system is a bit more coherent, if everything has a dedicated interface and we don't mix interfaces and factory function types within the service containers.
spoenemann
approved these changes
Apr 27, 2026
| var TypeFor_Command = reflect.TypeFor[Command]() | ||
|
|
||
| func (sc *StatemachineModelSymbolContainer) ForType(t reflect.Type) core.SymbolSeq { | ||
| switch t { |
Member
There was a problem hiding this comment.
Does the type switch also work for subtypes (e.g. an interface embedding the super-interface)?
Member
Author
There was a problem hiding this comment.
Yes, that's what the topological sorting is for. It's a bit cumbersome, but you can test it out by changing the grammar.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improves our linking infrastructure (through the board, i.e. both local symbols and exported/imported symbols) by using a generated type-optimized
SymbolContainer. It stores types (only those actually required, not all!) in buckets, which are then merged on demand.Since everything in the linking system has become
Symbol...or...Symbols, I've chosen to renameAstNodeDescriptiontoSymbolDescription. I believe this makes all of this a bit more coherent.Performance improvements are clearly visible when looking at our statemachine benchmark. The overall build performance has increase by roughly ~20%. Linking by itself is now faster by 30%.