@rylan
To test F# on Linux, follow the steps outlined below:
- Install .NET Core: F# runs on .NET Core, so start by installing it. Open a terminal and run the following commands:
- Download the Microsoft package repository configuration file:
1
|
wget https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
|
- Install the package repository configuration:
1
|
sudo dpkg -i packages-microsoft-prod.deb
|
- Install the required packages for package management over HTTPS:
1
|
sudo apt-get install -y apt-transport-https
|
- Update the package list again:
1
|
sudo apt-get install -y dotnet-sdk-5.0
|
- Verify the installation: After the installation is complete, check the installed .NET Core version by running:
- Install an F# development environment: Install Visual Studio Code by running:
1
|
sudo apt-get install -y code
|
- Install the Ionide-FSharp extension: Open Visual Studio Code, go to the Extensions tab on the sidebar, search for "Ionide-FSharp" extension, and install it.
- Create a new F# project: Open a terminal, navigate to your desired location, and run the following command to create a new F# project:
1
|
dotnet new console -lang F#
|
- Write and run F# code: Open the project folder in Visual Studio Code, access the "Program.fs" file, write your F# code, and save it. To run the code, open a terminal and run the following command in the project folder:
By following these steps, you can successfully test F# on Linux using .NET Core and Visual Studio Code.