-
Notifications
You must be signed in to change notification settings - Fork 789
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
Why Microsoft.FSharp.Core.netcore is based on netstandard1.5? #1217
Comments
FSharp.Core.dll for F# 4.0 is based on the BCL that shipped with CLR 4.0. There are portable variants of FSharp.Core.dll for profile 7 (Windows 8), profile 47 (Win Phone 7), profile 78 (Windows 8 + Phone 8) and profile 259 (Windows 8.1 + Phone 8.1) for developers targeting specific combinations of end platforms. FSharp.Core.dll for coreclr uses a number of new reflection and ref-emit API's (or at least new to portable) that are not available in 259, it uses the Console class for console IO, and LoadContext. If you look in the project json you will see it's dependencies, for the most they are necessary, I expect we could downward rev a few of the contracts. But in the main the later form of the contracts add back APIs that were missing from portable. Kevin |
Got it. |
So really our options to port to fsharp libraries to work on .net core are:
|
Closing this discussion for now (feel free to add more to it) |
@KevinRansom Any updates? If not, does FSharp.Core really need to use the Console class? |
@21c-HK --- printfn --- perhaps. |
Maybe it is reasonable to split I have F# bindings for Hence what is the reason to have a single monolithic package instead of small compostable pieces? |
Great example! That really makes it difficult to go down to .NET standard 1.0. In hindsight, it is really unfortunate that this function is preventing F# from being universally portable. |
FYI the code for that is here: https://github.com/Microsoft/visualfsharp/blob/master/src/fsharp/FSharp.Core/printf.fs#L1381 And the baseline is We're in a bit of an annoying point-in-time issue with this right now, given that .NET Standard 2.0 is on the horizon and is the "true" .NET Standard Library that .NET things will depend on in the future, in addition to bringing back all the critical APIs which are unavailable on .NET Core and .NET Standard today. The way I see it, there are a few options here:
Regardless, I think it's a bit of a lower priority thing at the moment because we're still not at RTM tooling support for .NET Core and .NET Standard (even for C#). |
The suggestion by @xperiandri is brilliant. Maybe consider making I guess this shoule be a separate suggestion though. I always believed that assemblies should be defined by their dependencies and not by other arbitrary factors. |
Sorry, @cartermp beat me to it with option 1, which I think is the best option out of the three, but I have no insight in what the current status and priorities of .NET Core and F# are. I like option 1 because it is the cleanest. Option 2 & 3 always bite you in the ass in the long-run. |
Not at all 21c-HK use the Portable 259 version of FSharp.Core.dll and only use the Api's it allows. Then you can create very portable libraries that will run on platforms from Xamarin iOS And Android all the way to Windows Desktop, Windows Metro and Win Phone 8. .Net Standard of it's various versions will also achieve a good range of portability. But right now we do have a point in time problem, I think .NetStandard 2.0 will really rock the cross platform thing. The biggest issue with refactoring FSharp.Core.dll is compatability with legacy code and libraries. If we were starting now we might factor it differently ... although not necessarily ... and it's fair to say that every developer values slightly different things. Allthough we could use type forwarders to move types about ... but then deployment gets really messy, however, nuget and paket may offer ways out of that. Kevin |
I was hoping that we could get rid of portable profiles and use a shared core instead. Ideally, there would be a |
@21c-HK |
Created separate issue about splitting #1955 |
Edit: Updated to correct the out-dated information in Introducing .NET Standard thanks to @cartermp (i.e. .new APIs in NET Standard 1.5 and 1.6 will not be removed and .NET Standard 2.0 stays a strict superset of earlier versions). @cartermp I think you should really go for .NET Standard 1.4 or 1.3 because UWP 10 (and all other .NET platforms that are relevant for the future) target 1.4.
The .NET team deems Reflection Emit as an optional self-contained component with regards to the .NET standard that should be provided as a seperate NuGet package on top of some .NET standard. I don't know how feasible that is for F#, but the corresponding quotes from Introducing .NET Standard are as follows:
Reading that blog post and re-reading all the comments in this thread, I think that @cartermp's 2. option to try to lower the target to .NET Standard 1.3 would give Then in the future, instead of targeting .NET Standard 2.0 with a single package, we could add the .NET Standard 2.0-specific APIs as a modular package on top of the monolithic |
@21c-HK While this doesn't mean that .NET Standard 1.6 as the target for FSharp.Core is where we want to be, it means we don't need to prioritize a change at this time. Ultimately this is the engineering team's decision, but I personally think that |
Thank you for the correction and pointing me to the FAQ on the .NET Standard! I missed that somehow.
Could you please clarify why type providers would need to be in FSharp.Core? Does referencing another package instead (e.g. |
It was a hypothetical thing. If, for some reason, we decided to add a set of Type Providers to FSharp.Core, the target of FSharp.Core would have to get bumped up to .NET Standard 2.0. I should have clarified the general case: If we wanted to have some kind of functionality in FSharp.Core which depended on .NET APIs which are only available in .NET Standard 2.0, we need to bump the target for FSharp.Core. |
Is the F# team against or for "layering" new F# features that require .NET Standard 2.0 on top of a Microsoft.FSharp.Core.netcore that targets .NET Standard 1.3/1.6 via separate packages? In other words, will "layering" be the preferred option to introduce new features into Microsoft.FSharp.Core.netcore or would you prefer to "retarget" the entire package to .NET Standard 2.0? I understand that if there was a non-optional F# feature that needed .NET Standard 2.0, then Microsoft.FSharp.Core.netcore should just be retargeted to .NET Standard 2.0. |
Personally I'm not opposed to such a layering, no. I doubt anyone here is; however, .NET Standard 2.0 presents a completely different world that I don't think we're really in a good position to make a call one way or another right now. |
FYI, the most relevant .NET Standard versions at the current point in time seem to be as follows:
I am really excited about .NET Standard as you might noticed ;-). |
FYI, according to the .NET Core roadmap, .NET Core 1.2 will be released in Spring 2017 targeting NET Standard 2.0, which .NET Framework 4.6.1 also targets (except for not supporting 43 new APIs that the .NET Standard 2.0 adds). |
Is it really necessary to depend on netstandard1.5 and not lower version?
FSharp.Core
for F# 4.0 is based on .NET Portable Profile 259 (portable-net45+netcore45+wpa81+wp8) which is netstandard1.0 according to thisI'm just wonder if it is really necessary and
Microsoft.FSharp.Core.netcore
uses something special from netstandard1.5 API surface not included in netstandard1.0The text was updated successfully, but these errors were encountered: