[Discussion] [RFC-1092] Add support for System.Half #500
Replies: 7 comments 2 replies
-
I think I can answer some:
Currently, My verdict: don't do this.
They were deliberately excluded from the runtime API proposal on the grounds that they require rounding. Since they are not in the explicit conversion operators, implementing it ourselves would undoubtedly lead to differences once the runtime catches up and provides these conversions. My verdict: don't do this.
This may actually lead to us postponing this implementation. I have some ideas how we can do this painlessly without a dependency, but if the past is any indication, this may be considered a blocker. |
Beta Was this translation helpful? Give feedback.
-
I am, thus far, in 100% agreement with @abelbraaksma ... and I’m still “noodling” on the final point (about compatibility with < |
Beta Was this translation helpful? Give feedback.
-
@cartermp Since .NET will continue to evolve and the future will see faster increase of versions and, likely, features, we'll need some way to allow a single I can think of several ways, but each has its drawbacks, here's a little brainstorm:
My preference is the the 3rd option, as, when done right, gives us a lot of freedom in implementing a proper cross-tfm FSharp.Core.dll cherry-picking optimized functions when they become available, and keeping up with new features added in the runtime. It may also be a way forward to start adding the long-awaited |
Beta Was this translation helpful? Give feedback.
-
So this won't happen for at least a year until FSharp.Core targets net5.0+? |
Beta Was this translation helpful? Give feedback.
-
It's my understandng that System.Half can be used directly using the name "System.Half" plus the existing available operators and types |
Beta Was this translation helpful? Give feedback.
-
@Happypig375 I've added a note to the RFC proposal here asking for clarification on the status-quo experience. I really believe it is likely to not be that bad, no worse than consuming any other user-defined C# numeric type from F#. Missing literals and a built-in https://github.com/fsharp/fslang-design/pull/499/files#r501840990 |
Beta Was this translation helpful? Give feedback.
-
Yeah, by now I wonder if we should drop this or not. We do have NS 2.0 and NS 2.1 for F# Core, but I don't see plans for .NET 6.0 or up on the horizon. I know I tried to champion this proposal, unless we find some useful way to support certain future features of .NET in F# Core and the compiler (i.e. literals and sprintf placeholders), I don't quite see this happening. |
Beta Was this translation helpful? Give feedback.
-
This thread is meant to discuss the proposal RFC-1092, see #499.
This follows language suggestion: fsharp/fslang-suggestions#909.
Unresolved questions atm:
half: int -> half
andhalf: decimal -> half
even thoughSystem.Half
does not define them?Beta Was this translation helpful? Give feedback.
All reactions