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

.NET 9 Unsafe Study #94941

Open
AndyAyersMS opened this issue Nov 17, 2023 · 2 comments
Open

.NET 9 Unsafe Study #94941

AndyAyersMS opened this issue Nov 17, 2023 · 2 comments
Labels
area-Meta User Story A single user-facing feature. Can be grouped under an epic.
Milestone

Comments

@AndyAyersMS
Copy link
Member

In .NET 9 we plan to study the use of unsafe constructs within the BCL, to better assess the risks they incur and benefits they provide. The aim of this study is to ensure we are making responsible use of unsafe.

The scope and outcome of this study is not yet determined, but may include things like:

  • Modernizing the definition of “unsafe” (or unsafe-equivalent) code
  • Guidelines for introduction of new unsafe code in the BCL, and possibly guidelines for general .NET development
  • Identification of existing unsafe code that can be replaced with safe equivalents
  • API changes or additions to avoid the need to rely on unsafe constructs
  • Recommendations for new or improved JIT optimizations to widen the set of unsafe code that can be replaced
  • Tooling to track the aggregate amount of unsafe code
  • The possibility of using source generators to “safely” generate unsafe code

Initially we will be gathering data about overall usage (and how it has changed over time) and doing case studies of code that uses unsafe constructs. As the study progresses, we will update this issue to keep track of interim findings, examples, discussions, proposals, and eventually, plans and work items.

@AndyAyersMS AndyAyersMS added the User Story A single user-facing feature. Can be grouped under an epic. label Nov 17, 2023
@AndyAyersMS AndyAyersMS added this to the 9.0.0 milestone Nov 17, 2023
@ghost
Copy link

ghost commented Nov 17, 2023

Tagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.

Issue Details

In .NET 9 we plan to study the use of unsafe constructs within the BCL, to better assess the risks they incur and benefits they provide. The aim of this study is to ensure we are making responsible use of unsafe.

The scope and outcome of this study is not yet determined, but may include things like:

  • Modernizing the definition of “unsafe” (or unsafe-equivalent) code
  • Guidelines for introduction of new unsafe code in the BCL, and possibly guidelines for general .NET development
  • Identification of existing unsafe code that can be replaced with safe equivalents
  • API changes or additions to avoid the need to rely on unsafe constructs
  • Recommendations for new or improved JIT optimizations to widen the set of unsafe code that can be replaced
  • Tooling to track the aggregate amount of unsafe code
  • The possibility of using source generators to “safely” generate unsafe code

Initially we will be gathering data about overall usage (and how it has changed over time) and doing case studies of code that uses unsafe constructs. As the study progresses, we will update this issue to keep track of interim findings, examples, discussions, proposals, and eventually, plans and work items.

Author: AndyAyersMS
Assignees: -
Labels:

area-Meta, User Story

Milestone: 9.0.0

@jeffhandley
Copy link
Member

@AndyAyersMS I know we made some progress on this in 9.0.0. I'm going to move this to 10.0.0 to keep the effort going.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Meta User Story A single user-facing feature. Can be grouped under an epic.
Projects
None yet
Development

No branches or pull requests

2 participants