How can we improve the Windows dev platform?

Allow unsafe code

Full unsafe code support would:
1) Allow more code to be shared across platforms, and
2) Increase the performance of applications that needed it.

Here's a use case example:
I'm the author of BEPUphysics, a real-time simulation library. I wish to support many platforms as best I can with as much common code as possible. Unfortunately, in the current situation, I can't have the best of both worlds. If my goal is optimal performance, I must maintain separate codebases for a bunch of low-level queries and data structures. On the other hand, if my goal is as much common code as possible, I'm forced to use the suboptimal lowest common denominator, crippling all of the other platforms.

Over time, these competing motivations have resulted in a codebase that is harder to maintain yet still isn't as fast as it could be.

While using C++ could provide the necessary access and performance, many of the potential uses in simulation are sufficiently fine-grained that dropping to C++ from C# repeatedly is at best horribly messy and at worst actually slower. (A full native implementation would address the performance side of things, but I can't justify the massive expense of porting for just one platform. It would also destroy a lot of value for the C#-based users of the library.)

Even if fallbacks had to be kept around to support other platforms that didn't allow unsafe code, enabling unsafe code on the phone would allow it to use the same efficient implementations as the PC. This would be very useful in the resource constrained environment of a phone.

55 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Ross NordbyRoss Nordby shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Laci Templar BittoLaci Templar Bitto commented  ·   ·  Flag as inappropriate

        Please consider to enable support for unsafe code in UWP apps. It's very usefull when you want to make application with, for example , voice or image processing.

      Feedback and Knowledge Base