Yes there is, but bare in mind the CLR for .NET 3.5 and .NET 2.0 are the same. So the only difference is the additional libraries.

Check the FLinq sample in the F# distribution samples folder. build.bat would be helpful for your query.

%FSC% -I "C:\Program Files\LINQ Preview\Bin" -r System.Data.DLinq.dll -r Northwind.dll -r System.Query.dll -r System.Transactions.dll -r System.Xml.XLinq.dll -r flinq.dll -o flinqsamples.exe -O3 -g sample.fs linqsamples.fs dumper.fs dlinqsamples.fs xlinqsamples.fs sampleform.fs program.fs SampleForm.resx --quotation-data

Instead of preview folder try to grab the GAC resources.

By on 1/20/2008 5:05 AM ()

You guys are great, thanks for the quick answers!

I didn't know that the CLR wasn't changed. I was actually hoping for an improved JIT.

Stephan

By on 1/20/2008 5:15 AM ()

Actual .NET 3.5 inculdes .NET 2.0 SP1 some changes to the .NET 2.0 runtime that you can't opt out of. Probably doesn't inculde any changes to JIT as most of the changes seem to be fairly minor. Scott Hanselman has more details:
[link:www.hanselman.com]

Cheers,
Rob

By on 1/20/2008 9:19 AM ()

Hi,

Is there a way to compile a F# program for .Net 3.5 (or to run a program compiled for .Net 2.0 on .Net 3.5)?

Thanks for any hint,
Stephan

You simply link to the new assemblies for System and System.<standard namespaces>. Here is an example that shows how to use it for the ParallelFX sample from Jurgen van Gael

#light

#r @"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll"

#R @"C:\Program Files\Microsoft Parallel Extensions Dec07 CTP\System.Threading.dll"

open System

open System.Threading

/// Measures the time it takes to execute a function

let Time f =

let timer = System.Diagnostics.Stopwatch.StartNew ()

let y = f ()

printfn "Time taken = %O" timer.Elapsed

y

/// A demonstration of parallel matrix multiplication. Taken from [link:mlg.eng.cam.ac.uk]

let MatrixMultiplyDemo () =

/// Ordinary multiply

let Multiply (A: float[,]) (B: float[,]) =

let n = Array2.length1 A

let C = Array2.create n n 0.0

for i = 0 to (n-1) do

for j=0 to n-1 do

for k=0 to n-1 do

C.[i,j] <- C.[i,j] + A.[i,k] * B.[k,j]

C

/// Fast multiply using Parallel-FX

let PFXMultiply (A: float[,]) (B: float[,]) =

let n = Array2.length1 A

let C = Array2.create n n 0.0

let RowTask i =

for j=0 to n-1 do

for k=0 to n-1 do

C.[i,j] <- C.[i,j] + A.[i,k] * B.[k,j]

Parallel.For(0, (n-1), new Action<int>(RowTask))

C

let n = 1000

let A = Array2.init n n (fun i j -> float (i * j))

let B = Array2.init n n (fun i j -> float (i * j))

printf "[Ordinary multiply of %dx%d matrix] " n n

Time (fun () -> Multiply A B) |> ignore

printf "[Fast multiply of %dx%d matrix] " n n

Time (fun () -> PFXMultiply A B) |> ignore

do

/// Prints a string with heading

let PrintWithHeading s =

let line = String.make (s |> String.length) '='

printfn "%s\n%s" s line

printfn "Parallel FX demos\n2007 written by Ralf Herbrich\n\n"

PrintWithHeading "Matrix Multiply"

MatrixMultiplyDemo ()

printfn "\n\nPress any key to finish"

read_line () |> ignore

Best wishes,

Ralf Herbrich

By on 1/20/2008 5:02 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper