You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose that the function's signature would be as the above. Furthermore, explicit type arguments should not be required. Even in constructs like Unchecked.defaultof and typeof, they are required, but can be circumvented by typing something like typeof<_> (when it doesn't make any sense at all).
The function above causes the compiler to complain twice about unverifiable code. The proposal should not produce any compiler warnings, just like in C#.
Also, returning a stackalloced Span from a function that created it should be forbidden in compile-time to avoid memory corruption, just like C#. For example, if I remove the inline modifier above, it would have led into some serious stack smashing occurrence.
Pros and Cons
The advantages of making this adjustment to F# are the ability to simply and safely exploit the memory in the stack and feature parity with the C# compiler.
The disadvantages of making this adjustment to F# are (the section is intentionally left blank)
Extra information
Estimated cost (XS, S, M, L, XL, XXL): M (for the last paragraph of my proposal, XS for the rest).
Affidavit (please submit!)
Please tick this by placing a cross in the box:
This is not a question (e.g. like one you might ask on stackoverflow) and I have searched stackoverflow for discussions of this issue
This is not something which has obviously "already been decided" in previous versions of F#. If you're questioning a fundamental design decision that has obviously already been taken (e.g. "Make F# untyped") then please don't submit it.
Please tick all that apply:
This is not a breaking change to the F# language design
I or my company would be willing to help implement and/or test this
The text was updated successfully, but these errors were encountered:
I propose we add a function that returns a
Span
pointing to stack memory.The existing way of approaching this problem in F# is ...
I propose that the function's signature would be as the above. Furthermore, explicit type arguments should not be required. Even in constructs like
Unchecked.defaultof
andtypeof
, they are required, but can be circumvented by typing something liketypeof<_>
(when it doesn't make any sense at all).The function above causes the compiler to complain twice about unverifiable code. The proposal should not produce any compiler warnings, just like in C#.
Also, returning a
stackalloc
edSpan
from a function that created it should be forbidden in compile-time to avoid memory corruption, just like C#. For example, if I remove theinline
modifier above, it would have led into some serious stack smashing occurrence.Pros and Cons
The advantages of making this adjustment to F# are the ability to simply and safely exploit the memory in the stack and feature parity with the C# compiler.
The disadvantages of making this adjustment to F# are (the section is intentionally left blank)
Extra information
Estimated cost (XS, S, M, L, XL, XXL): M (for the last paragraph of my proposal,
XS for the rest).Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply:
The text was updated successfully, but these errors were encountered: