Falling in love with F #: Dose 0.1: How to install F #

    Dear Habrakollegi!


    Thank you for the warm welcome of my notes on F #. Frankly, I did not expect so many interesting and useful comments! I apologize in advance, if I do not have time to answer everything, I will try.


    Before starting to fall in love with F # on these notes, I recommend that you install an appropriate programming environment for yourself. I apologize in advance to those who have already installed F # and are expecting more advanced posts from me: I try to state everything in order, so at first it can be boring.


    There are several ways to install F # (currently, the latest version is 1.9.6.2):



    1. The most correct: if you have Visual Studio 2008 (and any student can get it using the DreamSpark program ), then download F # September CTP (.msi) or a newer one from here to get everything you need. Please note that F # does not work with Visual Studio Express!
    2. If you do not have Visual Studio Pro , then you can install the free Visual Studio Shell , and on top of it: F # September CTP (.msi). Then you get Visual Studio with a single language - F #!
    3. If you are brave , you can immediately put Visual Studio 2010 CTP
    4. Finally, if you do not want to install Visual Studio and enjoy convenient contextual prompts and an editor with syntax highlighting - you can install F # September CTP (.msi or .zip) separately - at the same time you will get a set of command-line utilities (including the compiler and interpreter) . Of course, you will need the .NET Framework.
    5. If you work on U * # x-like systems , you can install Mono , and on top of it is F # September CTP (download the .zip file). Please note that F # September CTP requires Mono 2.0. If you, for example, like mine, have Ubuntu 8.10, then it has Mono 1.9 in it, and you will either have to upgrade Mono or install an older version of F # from here (I seem to have installed 1.9.3)

    By installing F #, you will receive the following features for using the language:


    • Fsc.exe command line compiler - with its help, you can compile executable files and assemblies in command mode.
    • Interpreter fsi.exe (F # Interactive). By running it, you can calculate F # expressions interactively and get the result:


    • Both use cases - interpretation and compilation - are available from Visual Studio. On the one hand, you can include F # projects in the Solution, on the other, open the F # Interactive interpreter window (View -> Other Windows -> F # Interactive or press Ctrl-Alt-F) for interactive work. In this case, it is enough to select a fragment of text in the text box at the top and press Alt-Enter so that this text is “calculated” in the lower window of the interpreter:



    I recommend that anyone who wants to try F # start with Visual Studio mode - write a program (or just text fragments) in the editing window, where all contextual prompts are available, and then select them and execute them in the interpreter window. In which case, you can go directly to the interpreter window and enter some expressions there (for example, to control intermediate values).


    So, in interpreter mode, F # is committed to calculating each input expression and outputting the result. The expression must end with two “semicolons” ;; In the simplest case, this is just an arithmetic expression (as 1 + 2 in the examples above), in the more complex case, the whole program. What expressions and constructions exist in the language - we will talk about this in the next, first lesson of programming in F #! For now, prepare your computers and install everything you need on them.



    Also popular now: