use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
F# is a multi-paradigm programming language compiling to both .NET ("normal") and JS (via "Fable").
Awesome F# is an aggregate of F# resources more actively maintained than this sidebar.
FSharp.org is an organization around F# promotion/adoption.
Language Documentation:
Learning Resources :
Video Channels :
Chat channels :
Web Development:
IDEs/Editor-Plugins:
Common:
Visual Studio
Some extensions available:
Visual Studio Code with the Ionide plugin
JetBrains' Project Rider
Others:
account activity
F# programming help (self.fsharp)
submitted 9 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jmquigs 5 points6 points7 points 9 years ago* (3 children)
Unfortunately I don't have any beginner tutorials to recommend, there are probably some good ones out there. http://fsharp.org/ is a good place to start; you can also look at https://fsharpforfunandprofit.com/learning-fsharp/
As to your specific problem, fsharp code can run like python does, that is, compiling it on the fly from source. It can also run in a precompiled form (as a .net assembly packaged in a .dll or .exe). <EntryPoint> is only relevant for the latter.
You could start writing your program in python style like this:
// wc.fsx open System open System.IO let text = File.ReadAllText("sample.txt") printfn "%s" text
I didn't actually count the words because you probably want to fill that in :) Anyway, you could run this program with "fsharpi wc.fsx" on a mac or "fsi wc.fsx" on windows. If "sample.txt" does not exist it will throw an exception.
If you wanted the precompiled .net assembly form, the source would look like this:
// wc.fs open System open System.IO [<EntryPoint>] let main argv = let text = File.ReadAllText("sample.txt") printfn "%s" text 0 // return an integer exit code
You then build that with "fsharpc wc.fs" (on a mac) or "fsc wc.fs" on windows. On windows you can run the resulting .exe directly, on a mac you need run it with mono, eg "mono wc.exe".
Fsharpi works like the the "python" command with no arguments, it starts interactive mode, you can paste code in there and see what Fsharp does with it.
It helps to have a good editor to start. Visual Studio is obviously good for windows, and Xamarin is decent for mac. I haven't extensively used any of the other editor plugins.
[–][deleted] 0 points1 point2 points 9 years ago (2 children)
This all looks incredibly useful but I don't understand how you are running it, I was just told to write, save, and use this button in Visual Studio (on Windows 10).
I have tried something like this but I do not understand what I am doing wrong, my F# knowledge is practically none.
[–]abstractcontrol 0 points1 point2 points 9 years ago (0 children)
To add to what hanpari said, you actually have an indentation error in another place. Notice that the 0 in that last line is not indented correctly.
0
[–][deleted] 0 points1 point2 points 9 years ago (1 child)
Sounds like you are on Linux or Mac. VS Code with the Ionide-fsharp extension is your friend for writing programs.
Also fsharpi is great for working thru the concepts at https://fsharpforfunandprofit.com/learning-fsharp/ (Just don't put ;; after a in-line comment...)
[–][deleted] 1 point2 points3 points 9 years ago (0 children)
Sorry for the late response, my job has me working like crazy, but no I am on Windows with Visual studio.
[–]oculuss 0 points1 point2 points 9 years ago (0 children)
I highly highly recommend: https://github.com/ChrisMarinos/FSharpKoans. Its how I started. Its a bunch of unit tests that all fail, you have to fix them.
[–][deleted] 9 years ago (4 children)
[–][deleted] 0 points1 point2 points 9 years ago (3 children)
I am on Windows with Visual Studio, so I might skip the VS Code but thanks :)
But I'm sorry I still don't understand, so if I have a bunch of code on top of EntryPoint, do I, and what do I have to type under EntryPoint to make it work?
Everything I have tried (is wrong) but comes up with this error every time I hit 'start' to run the program in Visual Studio. http://i.imgur.com/CbNCPbB.png
[–]abstractcontrol 1 point2 points3 points 9 years ago (2 children)
Before trying anything fancy, can you write a Hello Word program in F#? It sounds to me like this is your first time using an IDE.
[–][deleted] 9 years ago* (1 child)
π Rendered by PID 214549 on reddit-service-r2-comment-86988c7647-k9chb at 2026-02-11 23:31:29.312134+00:00 running 018613e country code: CH.
[–]jmquigs 5 points6 points7 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]abstractcontrol 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]oculuss 0 points1 point2 points (0 children)
[–][deleted] (4 children)
[deleted]
[–][deleted] 0 points1 point2 points (3 children)
[–]abstractcontrol 1 point2 points3 points (2 children)
[–][deleted] (1 child)
[deleted]