Skip to content

.NET 9 Unsafe Study #94941

Open
Open
@AndyAyersMS

Description

@AndyAyersMS

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.

.NET 10 Work

Misc:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions