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

User Story: Source generators are created to support native AOT #44430

Closed
2 tasks
samsp-msft opened this issue Nov 9, 2020 · 3 comments
Closed
2 tasks

User Story: Source generators are created to support native AOT #44430

samsp-msft opened this issue Nov 9, 2020 · 3 comments
Assignees
Labels
area-Meta untriaged New issue has not been triaged by the area owner User Story A single user-facing feature. Can be grouped under an epic.

Comments

@samsp-msft
Copy link
Member

Source Generators are a new technology that was added to Roslyn in the .NET 5 timeframe, but we have not yet utilized them by creating generators to assist with runtime and framework features. We will work to define customer scenarios in more detail here with customer development.

Code that uses runtime reflection and reflection.emit causes issues for Native AOT. Source generators can be used to generate alternative code at build time that is static so can be compiled without requiring reflection.

  • System.Text.Json serialization – code generators can work around the need for runtime reflection, and generate serializers for specific classes.
  • EventSource – event source uses reflection.emit to simplify creation of classes (manifests) for custom event sources – this can be changed to a build-time activity using source generators.
@samsp-msft samsp-msft added the User Story A single user-facing feature. Can be grouped under an epic. label Nov 9, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Meta untriaged New issue has not been triaged by the area owner labels Nov 9, 2020
@samsp-msft
Copy link
Member Author

Refactored from #43545

@samsp-msft
Copy link
Member Author

Removing as there are applicable issues already for each of these that I have converted to epics.

@noon2a
Copy link

noon2a commented Dec 5, 2020

Source Generators are a new technology that was added to Roslyn in the .NET 5 timeframe, but we have not yet utilized them by creating generators to assist with runtime and framework features. We will work to define customer scenarios in more detail here with customer development.

Code that uses runtime reflection and reflection.emit causes issues for Native AOT. Source generators can be used to generate alternative code at build time that is static so can be compiled without requiring reflection.

  • System.Text.Json serialization – code generators can work around the need for runtime reflection, and generate serializers for specific classes.
  • EventSource – event source uses reflection.emit to simplify creation of classes (manifests) for custom event sources – this can be changed to a build-time activity using source generators.

@ghost ghost locked as resolved and limited conversation to collaborators Jan 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Meta untriaged New issue has not been triaged by the area owner User Story A single user-facing feature. Can be grouped under an epic.
Projects
None yet
Development

No branches or pull requests

6 participants