Jun 26

F# Performance - writing high performance code

F# uses the compilation facilities of the .NET CLR to generate high performance native code via the Common IL intermediary form. F# has the succinctness of a scripting language, and yet static type-checking and type-inference ensure that compact data representations are used and high performance efficient code is generated for all language constructs.

This page gives further tips on improving the performance of your F# code.

Optimizing your code

Faster code is produced by using the cross module optimizer (the “-O” options).

Jun 26

F# Hello Winform

The following is a hello world WinForms example:

    open System
    open System.Windows.Forms

    let form = new Form()
    do form.Width  
              

If you save the above as

    devsrchelloforms.fs

then assuming fsc is in your path, you can compile and run it as follows:

    cd devsrc
    fsc devsrchelloforms.fs
    helloforms.exe