Get started with F# on Mac with VSCode and Ionide

Get started with F# on Mac with VSCode and Ionide

Yesterday, a friend of mine asked me what was the easiest way to get started with F# on Mac. I pointed him to which gives multiple options to install F# on Mac but it doesn’t contain the option of using VSCode with Ionide. Since I think it is the most straight forward way to have an environment setup to use of F# rapidly especially when someone wants to just have a quick look, I decide to write a blog post to go through the installation step by step.

The steps are:

  1. Install brew
  2. Install mono from brew
  3. Install VSCode
  4. Install Ionide
  5. Write a .fsx script

1. Install brew

To install brew, start a terminal and paste the following:

/usr/bin/ruby -e "$(curl -fsSL"


Homebrew is a package manager. We will use it to install mono. After executing the command, you should have access to brew from the terminal.

2. Install mono

Mono is an open source implementation of Microsoft’s .NET Framework

To install mono, start a terminal and paste the following:

brew install mono


After you installed mono, you should have access to fsharpi. fsharpi is the fsharp interactive also called FSI.


3. Install VSCode

Install Visual studio code Visual studio code is a code editor which also allows developpers to write plugins against it. Thanks to the amazing work of @k_cieslak, we can use F# with VSCode using Ionide. Ionide is a package suite which provides interaction with FSI, autocompletion, syntax highlighting and many more amazing things.

4. Install Ionide

If we go to the Visual studio marketplace and look for Ionide, we should be able to find ionide-fsharp

Below Installation, the website gives us an indication on how to install the packge on VSCode.

Launch VS Code Quick Open (b  +P), paste the following command, and type enter.

ext install Ionide-fsharp


That’s it, you have all the necessary tools to write code in F# now.

5. Write a .fsx script

Now that you have all the stuff needed. Create a .fsx file and paste the following:

let helloWorld =
    "Hello world from FSI"

printfn "%s" helloWorld

Select the whole text and hit ALT + ENTER. If everything is alright, this command will execute the highlighted code in the FSI.



Today we saw a quick way to get started with F# scripts. As a starter I would suggest to look at an example from @ScottWlaschin website Have a look at the tic tac toe example. Coming from an OOP language, it was really helpful for me. If you have any issue, please let me know here or hit me on Twitter @Kimserey_Lam!


  1. Thank you for a good simple getting started!

    printfn helloWorld should be printfn "%s" helloWorld in the example (it is in the image)

    1. Happy you enjoyed it :)
      Thanks for highlighting the mistake, I've corrected it!

  2. Please submit a PR to add this option to

    Don Syme

  3. hello, i've just installed Ionide-fsharp in vscode linux mint
    when i press alt + enter, there's a message 'cannot spawn FSI, ensure it's in PATH'. after i checked, the fsharpi and fsharpc file is inside 'usr/bin' folder
    i've added that folder in my PATH variable environment, but still it's not working

    could you help me with this error message?


    1. Hi thanks for reading my post! Make sure your path is added properly by trying to access "fsharpi" from bash and it should work.


Post a Comment

Popular posts from this blog

Verify dotnet SDK and runtime version installed

A complete SignalR with ASP Net Core example with WSS, Authentication, Nginx

Manage assets and static files with Angular CLI