fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Consider deprecating desktop framework version of the F# compiler and FSI program

Open KevinRansom opened this issue 9 months ago • 6 comments

Visual Studio currently ships a desktop framework version of the F# compiler and F# interactive application in addition to the coreclr versions shipped with the Dotnet SDK.

By default Visual Studio compiles F# applications using a desktop build of the compiler: E.g. C:\Program Files\Microsoft Visual Studio\2022\Community/Common7/IDE/CommonExtensions/Microsoft/FSharp/Tools/fscAnyCpu.exe

Visual Studio ships 3 desktop compilers in every Visual Studio:

  • 64Bit/32Bit - fscAnyCpu.exe
  • 32Bit - fsc.exe
  • Arm64 - fscArm64.exe

When bulding a solution or project from the command line the msbuild command also defaults to the desktop framework compilers above. There are Two project file settings which configures msbuild and Visual Studio to use the Dotnet SDK compiler. Also dotnet build and dotnet fsi default to the coreclr tooling.

image

  • By default Visual Studio uses the dotnet SDK version of FSI image

  • There is a Visual Studio Setting to configure VS to use one of the desktop versions of VS

image

Disadvantages:

  • Start up time of the coreclr fsc is significantly slower than the desktop version. Hello World builds in 2 seconds rather than 1 second
  • NetSDK cannot load libraries targeting the desktop framework unless they are netstandard2.0
  • NetSDK F# compiler cannot use type providers targeting the desktop framework unless they are netstandard2.0

Advantages

  • simplify development and testing.
  • We would only build and test the compiler once on the NetSDK rather than twice on NetSDK and desktop plus there are 3 Desktop compilers apps to be built and deployed, 32-Bit, AnyCPU and Arm64.
  • Same for fsi.
  • Easier deployment, we would deploy F# only with the SDK and via nuget. VS would not require it's own compilers.

KevinRansom avatar May 21 '24 03:05 KevinRansom