Brian's profileInside F#BlogGuestbookNetwork Tools Help

Blog


    August 29

    Welcome to the F# CTP project system: project templates

    As you may have already heard, the F# CTP has been released!  Here is the release announcement.  I'll continue describing the F# project system, but now that the CTP is out, you can follow along on your own machine, rather than just having to soak in the teaser screenshots I posted in prior blog entries.  :)

    Today's blog entry describes the F# project templates.  Whereas the prior releases of F# came with only one project template, the CTP release has three.  Inside Visual Studio, do a "File>New>Project" and select the "Visual F#" node to see this:

    ProjectTemplates

    (Aside: if you're like me, and you still have a prior install of F# on your machine, the old project template will still appear in "Other Project Types > F# Projects" under "Project types".  So if you're only seeing the old template after installing the CTP, make sure that you have selected the new "Visual F#" node and not the old "F# Projects" node:

    ProjectTemplateKinds

    Also, note that my screenshots today are from my computer at home, which has only the free Visual Studio 2008 Shell installed.  If you have a full version of Visual Studio, then you'll also see other project types, such as "Visual C#", in the "New Project" dialog.)

    There are three types of F# project templates in the F# CTP release; I'll describe each in turn.

    F# Application

    The "F# Application" template is used to build an executable program (EXE).  It will start you with a single source code file, Program.fs.  Type in some code, and you can just build and run:

    Application

    F# Library

    The "F# Library" template is used to build a library (DLL), which you might later reference from another application (and that application might be written in F#, or C#, or whatever - see my previous blog entry on project references).  The "F# Library" template starts you off with two files: Module1.fs, an F# source code file that will be compiled into the library DLL, and Script.fsx, an F# script file which is not compiled into the library DLL.  I'll talk more about F# script files in a future blog entry; briefly, scripts are one easy way to associate extra functionality (such as unit tests) with a particular project, without that functionality being compiled into the project.

    Library

    F# Tutorial

    The "F# Tutorial" template's main purpose is to demonstrate some of the main features and syntax of the F# language with some sample code.  If you are relatively new to the language, reading the code in Tutorial.fs is one way to get a quick introduction to F#.  It's also useful if you need a quick refresher to remember the syntax for a particular feature.  For instance, if I forget how to author a class that implements an interface, I can scroll down through the tutorial code and find:

    Tutorial

    There's lots more to talk about with the new project system... more blog entries coming soon!  (If you have questions in the meantime, feel free to post them in comments on this blog, or to use the forums on the hub.)

    Comments (4)

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    No namewrote:
    Its gr8 to see F# getting momentum..
    Sept. 17
    Gaurav Kalrawrote:
    Cool, I have been waiting for CTP release so long...
    Awesome, I m going to download ...
     
    Also, One thing i like to see in future CTP is support for WinForms project in F# ... ! Ofcourse , I know about other ways that i could use like create Form in C# and then refer through F# which is simple too.
    But i would like to see Designer that would generate Form code in F# style.
     
    Aug. 30
    Great!
     
    No "theme", I just dislike bright white backgounds, so I set the default window background color in Windows to grey rather than white.  (On Windows XP, right click the desktop, "Properties", "Appearance" tab, "Advanced" button, click the background of the Active Window, and set the color.  On Vista it's similar, but the first couple steps are "Personalize" and "Window Color and Appearance".)
    Aug. 29
    MichaelGGwrote:
    Congratulations. This is so exciting; I hope to have F# integrated into our builds before the weekend ends.

    As a side note, are you running a dark Windows theme? I've wanted this for so long, but could only get VS to go dark, making the contrast with other apps hurt to much. How did you do this? (You'd have thought with all the Vista hype, they'd somehow enable this, but, wow, they didn't.)
    Aug. 29

    Trackbacks

    Weblogs that reference this entry
    • None