### Install Local .NET SDK on Windows Source: https://github.com/dotnet/fsharp/blob/main/DEVGUIDE.md Download and install the correct .NET SDK version locally for Windows when working with non-released SDKs. ```shell .\eng\common\dotnet.cmd ``` -------------------------------- ### Install Local .NET SDK on Linux/macOS Source: https://github.com/dotnet/fsharp/blob/main/DEVGUIDE.md Download and install the correct .NET SDK version locally for Linux or macOS when working with non-released SDKs. ```shell ./eng/common/dotnet.sh ``` -------------------------------- ### Build and Test F# Repository Source: https://github.com/dotnet/fsharp/blob/main/DEVGUIDE.md Example commands to build the F# repository with specific configurations and run tests, useful for updating baselines. ```shell ./Build.cmd -c Release -testCoreClr ``` ```shell ./Build.cmd -c Release -testDesktop ``` -------------------------------- ### Build F# Compiler on Windows (No Visual Studio) Source: https://github.com/dotnet/fsharp/blob/main/README.md Use this command to build the F# compiler on Windows without requiring a Visual Studio installation. Ensure .NET SDK is installed. ```shell build.cmd -noVisualStudio ``` -------------------------------- ### Build F# Compiler on Windows Source: https://github.com/dotnet/fsharp/blob/main/README.md Use this command to build the F# compiler on Windows. Ensure .NET SDK is installed. ```shell build.cmd ``` -------------------------------- ### Install Visual F# VSIX Source: https://github.com/dotnet/fsharp/blob/main/DEVGUIDE.md Uninstall any existing VisualFSharp VSIX and then install the debug version. Use the Release VSIX for performance impact analysis. ```shell VSIXInstaller.exe /u:"VisualFSharp" VSIXInstaller.exe artifacts\VSSetup\Release\VisualFSharpDebug.vsix ``` -------------------------------- ### Build F# Compiler Service with Local SDK Source: https://github.com/dotnet/fsharp/blob/main/DEVGUIDE.md Build the FSharp.Compiler.Service project using regular dotnet commands after the local SDK has been installed. ```shell dotnet build FSharp.Compiler.Service.slnx ``` -------------------------------- ### Test F# Compiler Service with Local SDK Source: https://github.com/dotnet/fsharp/blob/main/DEVGUIDE.md Run tests for the FSharp.Compiler.Service project using regular dotnet commands after the local SDK has been installed. ```shell dotnet test tests/FSharp.Compiler.Service.Tests/ ``` -------------------------------- ### F# Interactive Script Example Source: https://github.com/dotnet/fsharp/blob/main/docs/fsi-emit.md A simple F# script demonstrating the use of `;;` as fragment delimiters and the definition and call of an internal function. ```fsharp let internal f() = 1;; f();; ``` -------------------------------- ### FSharp.Core.dll in Output Directory Source: https://github.com/dotnet/fsharp/blob/main/docs/fsharp-core-notes.md FSharp.Core.dll typically appears in the bin output folder for applications when deployed. This example shows a typical directory listing. ```text Directory of ...\ConsoleApplication3\bin\Debug\net5.0 18/04/2020 13:20 5,632 ConsoleApplication3.exe 14/10/2020 12:12 1,400,472 FSharp.Core.dll ``` -------------------------------- ### F# Full Type Name Example Source: https://github.com/dotnet/fsharp/blob/main/docs/names.md Example of a fully qualified type name in F#. ```fsharp SomeNamespace.OtherNamespace.SomeType ``` -------------------------------- ### Build and Run Benchmark Source: https://github.com/dotnet/fsharp/blob/main/tests/benchmarks/README.md Commands to build the project in Release configuration and then run the benchmarks. ```shell dotnet build -c Release dotnet run -c Release ``` -------------------------------- ### Run Documentation Tool Source: https://github.com/dotnet/fsharp/blob/main/docs/running-documentation-locally.md Execute the `fsdocs watch` command to build and serve the documentation locally. This command uses your local `dotnet/fsharp` fork as the source for documentation content. ```bash dotnet fsdocs watch --eval --sourcefolder ../fsharp/ --input ../fsharp/docs/ ``` -------------------------------- ### Build Repository with Release Configuration Source: https://github.com/dotnet/fsharp/blob/main/tests/benchmarks/CompiledCodeBenchmarks/README.md Use this command to build the repository with the Release configuration. Ensure you are in the project's root directory. ```powershell ./Build.cmd -c Release ``` -------------------------------- ### Start Visual Studio with Experimental Instance Source: https://github.com/dotnet/fsharp/wiki/Dev-Guide---Visual-F Use this command to launch Visual Studio with a separate experimental instance to avoid corrupting your main development environment. The suffix identifies a unique instance, e.g., '12.0MyExp'. ```shell devenv.exe" /RootSuffix MyExp ``` -------------------------------- ### FSharp.Core Surface Area Baseline Example Source: https://github.com/dotnet/fsharp/wiki/Dev-Guide---FSharp.Core This is an example of a one-line addition to the FSharp.Core public surface area baselines, used for validating changes to public types and members. It reflects the format for adding a new collection processing function. ```fsharp Microsoft.FSharp.Collections.ArrayModule: T[] MyNewArrayFunction[T](T[]) ``` -------------------------------- ### F# Interactive Command Line Source: https://github.com/dotnet/fsharp/blob/main/docs/fsi-emit.md Example of invoking F# Interactive with the `--optimize-` flag. ```bash artifacts\/bin\/fsi\/Debug\/net50\/fsi.exe --optimize- ``` -------------------------------- ### Run All Benchmarks Source: https://github.com/dotnet/fsharp/blob/main/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/README.md Execute all benchmarks defined in the project. Ensure you are in the project directory and use the Release configuration. ```bash dotnet run -c Release --filter * ``` -------------------------------- ### F# Interactive Command Line with Optimization Source: https://github.com/dotnet/fsharp/blob/main/docs/fsi-emit.md Example of invoking F# Interactive with the `--optimize+` flag. ```bash artifacts\/bin\/fsi\/Debug\/net50\/fsi.exe --optimize+ ``` -------------------------------- ### F# Integral Range: Simple Source: https://github.com/dotnet/fsharp/blob/main/tests/benchmarks/CompiledCodeBenchmarks/README.md Represents a simple integral range from start to finish. This is a basic F# range syntax. ```fsharp UInt32,[|1u..32767u|],ComputedCollections,Arrays,IntegralRanges ``` ```fsharp UInt32,[|for n in start..finish -> n|],ComputedCollections,Arrays,IntegralRanges ``` ```fsharp UInt32,[|start..finish|],ComputedCollections,Arrays,IntegralRanges ``` -------------------------------- ### Run BenchmarkDotNet Project Source: https://github.com/dotnet/fsharp/blob/main/tests/benchmarks/README.md Executes a BenchmarkDotNet project using the .NET CLI. Ensure you are in the benchmark's directory. ```bash dotnet run %BenchmarkProject.fsproj% ``` -------------------------------- ### Benchmark Results Directory Listing Source: https://github.com/dotnet/fsharp/blob/main/tests/benchmarks/README.md Example output of listing the contents of the benchmark results directory, showing generated report files. ```shell > ls .\BenchmarkDotNet.Artifacts\results\ Directory: C:\Users\vlza\code\fsharp\tests\benchmarks\FCSBenchmarks\FcsBench\BenchmarkDotNet.Artifacts\results Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 4/25/2022 1:42 PM 638 Program.CompilerService-report-github.md -a--- 4/25/2022 1:42 PM 1050 Program.CompilerService-report.csv -a--- 4/25/2022 1:42 PM 1169 Program.CompilerService-report.html ``` -------------------------------- ### Build and Restore NuGet Packages Source: https://github.com/dotnet/fsharp/wiki/Running-and-Debugging-IDE-Code Run these commands to build the project and restore necessary NuGet packages. Ensure both commands complete successfully. ```batch build.cmd build.cmd vs ``` -------------------------------- ### F# Type Provider with Underscore Typars Source: https://github.com/dotnet/fsharp/blob/main/docs/names.md Example of a type provider display name using an underscore for elided static parameters. ```fsharp List< _ > ``` -------------------------------- ### Build F# Repository on Mac/Linux Source: https://github.com/dotnet/fsharp/blob/main/DEVGUIDE.md Execute this command from the repository root on Mac or Linux to build the F# repository in Release configuration. ```shell sh build.sh -c Release ``` ```shell ./build.sh -c Release ``` -------------------------------- ### FCS API Renaming Example Source: https://github.com/dotnet/fsharp/blob/main/release-notes.md Illustrates API renamings in FSharp.Compiler.AbstractIL.Internal.Library and FSharp.Compiler.Layout modules. Use these new types and modules for updated functionality. ```diff -type FSharp.Compiler.AbstractIL.Internal.Library.IFileSystem +type FSharp.Compiler.SourceCodeServices.IFileSystem -module FSharp.Compiler.AbstractIL.Internal.Library.Shim +FSharp.Compiler.SourceCodeServices.FileSystemAutoOpens -type FSharp.Compiler.AbstractIL.Layout +type FSharp.Compiler.TextLayout.Layout -type FSharp.Compiler.AbstractIL.Internal.TaggedText +type FSharp.Compiler.TextLayout.TaggedText -type FSharp.Compiler.Layout.layout +type FSharp.Compiler.TextLayout.layout -type FSharp.Compiler.Layout.Layout +FSharp.Compiler.TextLayout.Layout -module FSharp.Compiler.Layout +module FSharp.Compiler.TextLayout.LayoutRender -module FSharp.Compiler.LayoutOps +module FSharp.Compiler.TextLayout.Layout -module FSharp.Compiler.Layout.TaggedText +module FSharp.Compiler.TextLayout.TaggedText -module FSharp.Compiler.Layout.TaggedTextOps +FSharp.Compiler.TextLayout.TaggedText -module FSharp.Compiler.Layout.TaggedTextOps.Literals +FSharp.Compiler.TextLayout.TaggedText -type FSharp.Compiler.Range.range +FSharp.Compiler.Text.Range -type FSharp.Compiler.Range.pos +FSharp.Compiler.Text.Pos -module FSharp.Compiler.Range.Range +module FSharp.Compiler.Text.Pos +module FSharp.Compiler.Text.Range -module FSharp.Compiler.QuickParse +module FSharp.Compiler.SourceCodeServices.QuickParse -module FSharp.Compiler.PrettyNaming +FSharp.Compiler.SourceCodeServices.PrettyNaming -val FSharpKeywords.PrettyNaming.KeywordNames +FSharp.Compiler.SourceCodeServices.FSharpKeywords.KeywordNames -val FSharpKeywords.PrettyNaming.QuoteIdentifierIfNeeded +FSharp.Compiler.SourceCodeServices.FSharpKeywords.QuoteIdentifierIfNeeded -val FSharpKeywords.PrettyNaming.FormatAndOtherOverloadsString +FSharp.Compiler.SourceCodeServices.FSharpKeywords.FormatAndOtherOverloadsString ``` -------------------------------- ### F# Type Provider with Static Parameters Source: https://github.com/dotnet/fsharp/blob/main/docs/names.md Example of a type provider display name showing static parameters, which can be large and are often elided. ```fsharp SomeTypeProvider<"foo.json"> ``` -------------------------------- ### Create F# Console Benchmark Project Source: https://github.com/dotnet/fsharp/blob/main/tests/benchmarks/README.md Use this command to create a new F# console application project for benchmarks within a specified directory. ```shell cd tests\benchmarks\FCSBenchmarks dotnet new console -o FcsBench --name FcsBench -lang F# ``` -------------------------------- ### Add BenchmarkDotNet and Project References Source: https://github.com/dotnet/fsharp/blob/main/tests/benchmarks/README.md Add the BenchmarkDotNet NuGet package and project references to your benchmark project. Ensure the paths to the FSharp.Compiler.Service and FSharp.Core projects are correct. ```shell cd FcsBench dotnet add package BenchmarkDotNet dotnet add reference ..\..\..\src\Compiler\FSharp.Compiler.Service.fsproj ``` -------------------------------- ### Add F# Prerelease Feed for 7.0.40x Series Source: https://github.com/dotnet/fsharp/blob/main/README.md Configure your NuGet sources to include the prerelease feed for the FSharp.Compiler.Service 43.7.400-preview packages. ```xml ``` -------------------------------- ### Build and Deploy Visual Studio Extensions Source: https://github.com/dotnet/fsharp/blob/main/DEVGUIDE.md Build the Visual F# extensions in Release configuration and deploy them using Build.cmd. Then, launch Visual Studio with the RoslynDev root suffix to test changes. ```shell Build.cmd -c Release -deployExtensions devenv.exe /rootsuffix RoslynDev ``` -------------------------------- ### Build F# Compiler on Linux or macOS Source: https://github.com/dotnet/fsharp/blob/main/README.md Build the F# compiler on Linux or macOS using this command. Ensure .NET SDK is installed. ```shell ./build.sh ``` -------------------------------- ### FSharp.Core Performance Improvement Example Source: https://github.com/dotnet/fsharp/blob/main/release-notes.md This pull request details a performance improvement for the core collections Map in FSharp.Core. It highlights contributions from Victor Baybekov. ```fsharp Performance improvement ```