Create Hello World in F#
Jan 3, 2023
To create a “Hello, world!” program in F#, you can use the following code:
printfn "Hello, world!"
This code will print the message “Hello, world!” to the console.
To run this code, you can save it to a file with a .fsx
extension and then execute it using the dotnet fsi
command. For example:
dotnet fsi hello.fsx
Alternatively, you can use an F# interactive window in an integrated development environment (IDE) such as Visual Studio or Visual Studio Code to write and run F# code.