-
Notifications
You must be signed in to change notification settings - Fork 783
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
RFC FS-1006 Struct Tuples and Interop with C# 7.0 Tuples #1043
Conversation
Current failures are all to do with the added FSHarp.Core surface area. This will disappear once we can use a System.ValueTuples.dll from .NET
|
and remapTupInfoAux _tyenv unt = | ||
match unt with | ||
| TupInfo.Const _ -> unt | ||
//| TupInfo.Var tp as unt -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is all this commented out? Just curious! That's all :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove it. It was related to this possible extension
I just did a brief scan of everything. I do have a pet peeve when I see commented code without an explanation for why something was commented out. I put in some comments, I don't know if they are helpful. I'm no expert here, so there may be good reasons for everything and I am only trying to help when I can! Otherwise, everything seems to look fine on my end; I haven't tested anything though. |
Just a side note, I've tested struct tuples in a scenario where they were supposed to speedup returning multiple values from a function http://vaskir.blogspot.ru/2016/05/upcoming-f-struct-tuples-are-they.html |
@vasily-kirichenko The current example isn't a good estimate, as if you compile the first non-struct tuple example in Release, it compiles to this:
It doesn't even construct the tuples in the first place. Try this:
|
@TIHan same time for your last snippet. |
When I use the first example @vasily-kirichenko posted, the compiler optimizes out the tuples. I didn't use this branch though. If I use the snippet I posted, I get similar timings. |
I also did this as a test:
My timings were:
An order of magnitude faster. I should just use this branch. |
I added results in release mode and added decompiled code as well (in the blog post). @dsyme |
Awesome to see this passing green |
…e FX_NOSTRUCTTUPLE now that dependency is reflection based.
Remove fsharp.core.dll references to System.ValueTuple.dll,
This looks very close to being ready. However I would expect we should wait until we are 100% certain of the final shape and form of the C# feature, and it has been committed and finalized. I'd hate to have F# commit and then C# change some design detail :) |
This code is raising caught exceptions on every FSharp.Core load
at least if System.ValueTuple is not in the compiler directory by some chance. But in any case it seems a bit inefficient on every library startup The root cause is that in reflect.fs, these should be computed on-demand rather than be top-level constants, so you only pay the cost once you start to use reflection
|
Dsyme tuple spike
Dsyme tuple spike
…nto dsyme-tuple-spike
Dsyme tuple spike
Fix isTuple for arrays and pointers.
@dsyme Thanks for this important feature. |
👍 👍 👍 🎉 🎉 🎉 😸 😸 😸 |
@dotnet-bot test this please |
This is the WIP PR for F# RFC FS-1006 Struct Tuples and Interop with C# 7.0 Tuples
Please discuss the implementation on this thread, and the RFC and design on the RFC discussion thread.