tag:blogger.com,1999:blog-37525736908548365222009-07-11T20:03:43.145ZF# NewsPutting the fun in functional programming since 2005!Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.comBlogger167125tag:blogger.com,1999:blog-3752573690854836522.post-45210853723235557732009-07-11T17:54:00.005Z2009-07-11T20:03:43.158ZFluid Dynamics demo from the F#.NET Journal<p><a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb">The F#.NET Journal</a> just made another <a href="http://www.ffconsultancy.com/products/fsharp_journal/code/FluidDynamics.exe">downloadable demo</a> freely available. This demo is from the article <em>Simulating smoke in real-time using fluid dynamics</em> (16th January 2008).</p><a href="http://4.bp.blogspot.com/_NMRkpon4Ps0/SljULy3G0VI/AAAAAAAAAFI/XT_OB_9tV-o/s1600-h/FluidDynamics.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 399px; height: 400px;" src="http://4.bp.blogspot.com/_NMRkpon4Ps0/SljULy3G0VI/AAAAAAAAAFI/XT_OB_9tV-o/s400/FluidDynamics.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5357265055853760850" /></a><p>The <a href="http://fsharpnews.blogspot.com/2009/01/simulating-smoke-in-real-time-using.html">article</a> develops and explains the entire program which, including parallelized numerical code and WPF-based visualization, is only 175 lines of F# code!</p><br /><p></p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-4521085372323555773?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-40761742430267633012009-07-07T00:11:00.004Z2009-07-07T00:25:16.947ZRay Tracer demo from The F#.NET Journal<p><a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb">The F#.NET Journal</a> just made another <a href="http://www.ffconsultancy.com/products/fsharp_journal/code/RayTracer.exe">downloadable demo</a> freely available. This demo is from the article <em>Implementing a simple Ray Tracer</em> (16th January 2008).</p><a href="http://2.bp.blogspot.com/_NMRkpon4Ps0/SlKUjkN_5TI/AAAAAAAAAE4/ssdngT3Mgls/s1600-h/ray.png"><img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 400px; DISPLAY: block; HEIGHT: 400px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5355506245635663154" border="0" alt="" src="http://2.bp.blogspot.com/_NMRkpon4Ps0/SlKUjkN_5TI/AAAAAAAAAE4/ssdngT3Mgls/s400/ray.png" /></a> <p>The <a href="http://fsharpnews.blogspot.com/2008/01/f.html">article</a> develops and explains the entire program which, including ray intersection routines, visualization, parallelization and GUI controls, is only 160 lines of F# code!</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-4076174243026763301?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-7792646338594879842009-07-06T13:54:00.001Z2009-07-06T13:56:26.469ZF# development with Visual Studio 2008<p><a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb54">The F#.NET Journal</a> just published an article about the current integrated development environment for F#:</p><p><em>"The May 2009 Community Technology Preview (CTP) release of F# includes an advanced Visual Studio mode for F# development. This article describes how this may be installed (including the free version of Visual Studio) and used to evaluate F# code interactively and develop F# applications including the generation of standalone .NET executables suitable for redistribution and the static linking of other .NET assemblies (e.g. C# compiled to DLL) as well as new features in the development environment itself..."</em></p><p>To read this article and more, subscribe to <a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb54">The F#.NET Journal</a> today!</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-779264633859487984?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-90461437102276546772009-07-06T13:53:00.002Z2009-07-06T13:54:13.698ZF# for Visualization 0.4.0.1 released<p>A minor bug fix release of <a href="http://www.ffconsultancy.com/products/fsharp_for_visualization/?fsb">F# for Visualization</a> is now available.</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-9046143710227654677?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-88201942830011090972009-06-17T09:32:00.002Z2009-06-17T09:34:56.233ZLeast squares: a case study in optimization<p><a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb53">The F#.NET Journal</a> just published an article about curve fitting:</p><p><em>"The challenge of finding the least squares best fit of a linear sum of functions is a common problem in regression. Linear algebra provides a powerful and general solution by expressing this problem in terms of matrices and then computing the QR decomposition in order to solve the matrix equation. This article describes a remarkably simple implementation of QR decomposition in F# before developing progressively more optimized implementations using the guidance of performance profiles and without sacrificing generality. In particular, heavy use of the F# keyword "inline" is made in order to express efficient reusable numerical methods..."</em></p><p>To read this article and more, subscribe to <a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb53">The F#.NET Journal</a> today!</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-8820194283001109097?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-74587347636803236872009-06-12T02:22:00.003Z2009-06-12T02:39:22.534ZF# for Numerics 0.2.0.2 released<p>A new version of our <a href="http://www.ffconsultancy.com/products/fsharp_for_numerics/?fsb">F# for Numerics</a> library for F# has been released. This version includes:</p><ul><li>Eigenvalues and eigenvectors of real symmetric matrices (the <span style="font-family:courier new;">LinearAlgebra.Float.symmetric_eigen</span> and <span style="font-family:courier new;">LinearAlgebra.Float32.symmetric_eigen</span> functions).</li><li>Singular Value Decomposition of real matrices (the <span style="font-family:courier new;">LinearAlgebra.Float.svd</span> and <span style="font-family:courier new;">LinearAlgebra.Float32.svd</span> functions).</li><li>Complex Cholesky decomposition of positive definite Hermitian matrices (the <span style="font-family:courier new;">LinearAlgebra.Complex.cholesky</span> function).</li><li>Real and complex Log Gamma function (the <span style="font-family:courier new;">Special.gammaln</span> and <span style="font-family:courier new;">Special.Complex.gammaln</span> functions).</li><li>Real and complex Beta function (the <span style="font-family:courier new;">Special.beta</span> and <span style="font-family:courier new;">Special.Complex.beta</span> functions).</li></ul><p>The HTML documentation for this product is freely available <a href="http://www.ffconsultancy.com/products/fsharp_for_numerics/docs/FSharpForNumerics/FlyingFrog.html">on-line</a>.</p><p></p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-7458734763680323687?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-21878432923634611252009-06-10T15:52:00.007Z2009-06-10T18:37:17.653ZF# for Visualization 0.4.0.0 released<p><a href="http://www.ffconsultancy.com/products/fsharp_for_visualization/?fsb">F# for Visualization</a> version 0.4.0.0 has just been released. This version includes a variety of enhancements.</p><p>Perhaps the most important enhancement is the introduction of dynamically typed functions <span style="font-family:courier new;">scene</span> and <span style="font-family:courier new;">Typeset.math</span> which try to build vector scenes and typeset mathematical layouts, respectively, from values of any type. The <span style="font-family:courier new;">View</span> function can be used to visualize any value of any type. For example, the following defines and then visualizes a matrix of rational numbers:</p><pre>> let A =
    Matrix.Generic.of_seq
      [ for i in 0N..4N ->
          [ for j in 0N..4N ->
              1N / (i + j + 1N) ] ];;
val A : Matrix<BigNum> = matrix [[1N; 1/2N; 1/3N; 1/4N; 1/5N]
                                 [1/2N; 1/3N; 1/4N; 1/5N; 1/6N]
                                 [1/3N; 1/4N; 1/5N; 1/6N; 1/7N]
                                 [1/4N; 1/5N; 1/6N; 1/7N; 1/8N]
                                 [1/5N; 1/6N; 1/7N; 1/8N; 1/9N]]
> View A;;</pre><a href="http://3.bp.blogspot.com/_NMRkpon4Ps0/Si_rTVKUQ7I/AAAAAAAAAEY/2Eux0WSnBec/s1600-h/matrix.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 283px;" src="http://3.bp.blogspot.com/_NMRkpon4Ps0/Si_rTVKUQ7I/AAAAAAAAAEY/2Eux0WSnBec/s400/matrix.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5345750000042525618" /></a><p>This makes it a <i>lot</i> easier to see what is going on during matrix computations!</p><p>Plots may now be augmented with an "epilog". For example, the following creates a graph of the sinc function:</p><pre>let g = Plot([Function sinc], (-12., 12.), (-0.3, 1.1))</pre><a href="http://1.bp.blogspot.com/_NMRkpon4Ps0/Si_6VPR_e2I/AAAAAAAAAEg/BX68pUUO1yc/s1600-h/sinc1.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 283px;" src="http://1.bp.blogspot.com/_NMRkpon4Ps0/Si_6VPR_e2I/AAAAAAAAAEg/BX68pUUO1yc/s400/sinc1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5345766525498260322" /></a><p>Accurately typeset axis labels may be added to create a professional-quality plot:</p><pre>g.Labels <- (Char 'x', Row[Text "sinc"; math "(x)"])</pre><a href="http://4.bp.blogspot.com/_NMRkpon4Ps0/Si_6lmcUOkI/AAAAAAAAAEo/r5wpVypuzSw/s1600-h/sinc2.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 283px;" src="http://4.bp.blogspot.com/_NMRkpon4Ps0/Si_6lmcUOkI/AAAAAAAAAEo/r5wpVypuzSw/s400/sinc2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5345766806593485378" /></a><p>Finally, the first positive root of this function may be highlighted by adding a single data point and a label describing the exact coordinate:</p><pre>let pi = System.Math.PI
g.Data <- [Function sinc; Data[pi, 0.]]
g.Epilog <- Label(scene(Row[math "("; Greek.pi; math ", 0)"]),
                  0.003, Point(System.Math.PI, 0.), Vector(1.2, 1.2))</pre><a href="http://2.bp.blogspot.com/_NMRkpon4Ps0/Si_8FrQqpHI/AAAAAAAAAEw/FnYy-DeiyhA/s1600-h/sinc3.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 283px;" src="http://2.bp.blogspot.com/_NMRkpon4Ps0/Si_8FrQqpHI/AAAAAAAAAEw/FnYy-DeiyhA/s400/sinc3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5345768457154241650" /></a><p>Axis and grid styles and the font sizes of ticks are now configurable.</p><p>Finally, the DLL is 30% smaller than before!</p><p></p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-2187843292363461125?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com2tag:blogger.com,1999:blog-3752573690854836522.post-46177780429205507442009-06-01T18:49:00.004Z2009-06-01T18:57:52.635ZSudoku Solver demo from the F#.NET Journal<p><a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb">The F#.NET Journal</a> just made another <a href="http://www.ffconsultancy.com/products/fsharp_journal/code/SudokuWF.exe">downloadable demo</a> freely available. This demo is from the article <em>Designing and implementing a Sudoku Solver</em> (30th June 2007).</p><a href="http://3.bp.blogspot.com/_NMRkpon4Ps0/SiQkSf2nGTI/AAAAAAAAAEI/EQVzEqpE9As/s1600-h/sudoku.gif"><img id="BLOGGER_PHOTO_ID_5342434958175050034" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 254px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_NMRkpon4Ps0/SiQkSf2nGTI/AAAAAAAAAEI/EQVzEqpE9As/s400/sudoku.gif" border="0" /></a><p>The entire program, developed and explained in the article, including logic solver and programmatic GUI is under 150 lines of F# code!</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-4617778042920550744?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-39256245429530800312009-06-01T04:20:00.003Z2009-06-01T04:30:06.598ZVisualizing linear algebra: Singular Value Decomposition<p><a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb52">The F#.NET Journal</a> just published an article about the interactive visualization of linear algebra:</p><p><em>"Singular Value Decomposition (SVD) is an important algorithm from linear algebra that decomposes a matrix into the product of three simpler matrices. The resulting decomposition has several applications. This article describes the design and implementation of an F# program that computes the SVD of an image and uses it to create a lossy compression algorithm with controllable quality. This involves numerical methods for computing the eigenvalues of real symmetric matrices and interactive visualization of the result as a standalone Windows Presentation Foundation application that uses the Task Parallel Library to leverage multicores..."</em></p><p>To read this article and more, subscribe to <a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb52">The F#.NET Journal</a> today!</p><p>A self-contained <a href="http://www.ffconsultancy.com/products/fsharp_journal/code/SVD.exe">executable demo</a> of the program developed in this article is freely available.</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-3925624542953080031?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-87772240931890316082009-05-26T23:28:00.006Z2009-06-02T20:17:34.037ZDownloadable demos from the F#.NET Journal<p>Articles published in the F#.NET Journal often culminate in fun graphical programs. Consequently, we have begun the process of uploading demos that everyone can download and enjoy. The first such demo, from the article <em>Real-time Finite Element Materials simulation</em> (15th June 2008), is now freely available for download from <a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb">the F#.NET Journal web page</a>.</p><p>This demo simulates a simple 2D material using finite element methods and the flexible object can be grabbed and pulled with the mouse in order to deform and even smash it:</p><p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_NMRkpon4Ps0/SiWINuVJEXI/AAAAAAAAAEQ/8QoaKNXkbhM/s1600-h/springies.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 229px; height: 229px;" src="http://3.bp.blogspot.com/_NMRkpon4Ps0/SiWINuVJEXI/AAAAAAAAAEQ/8QoaKNXkbhM/s400/springies.gif" alt="" id="BLOGGER_PHOTO_ID_5342826302301344114" border="0" /></a></p><p>The entire self-contained F# program is under 200 lines of code and uses Windows Presentation Foundation for easy and efficient real-time visualization.</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-8777224093189031608?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-74036857609830558722009-05-22T11:27:00.005Z2009-05-22T11:33:11.049ZF# for Numerics 0.1.0.1 and F# for Visualization 0.3.2.2<p>We have completed the updates of our <a href="http://www.ffconsultancy.com/products/fsharp_for_numerics/?fsb">F# for Numerics</a> and <a href="http://www.ffconsultancy.com/products/fsharp_for_visualization/?fsb">F# for Visualization</a> libraries to work with the latest <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=7bb32f32-9fac-4f34-ad56-b0bda130cf00">F# May 2009 CTP (1.9.6.16)</a> and the results are now available to our beta release scheme subscribers.</p><p>Although the latest version of F# contains many improvements and breaking changes, the updates turned out to be relatively straightforward and the resulting libraries passed all tests first time. Congratulations to the F# team for such a polished release! We recommend that all users upgrade to the latest F# for a better development experience.</p><p> </p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-7403685760983055872?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com1tag:blogger.com,1999:blog-3752573690854836522.post-20032979564923885072009-05-21T21:30:00.005Z2009-05-27T00:43:26.156ZPythagoras Tree<p>A Pythagoras tree is a simple vector graphics image:</p><a href="http://1.bp.blogspot.com/_NMRkpon4Ps0/ShXJdjFzXTI/AAAAAAAAADo/ADXDiW7Znu4/s1600-h/pythagoras_tree.png"><img id="BLOGGER_PHOTO_ID_5338394442790559026" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 247px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_NMRkpon4Ps0/ShXJdjFzXTI/AAAAAAAAADo/ADXDiW7Znu4/s400/pythagoras_tree.png" border="0" /></a> <p>The following <a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb">F#</a> program uses the <a href="http://www.ffconsultancy.com/products/fsharp_for_visualization/?fsb">F# for Visualization</a> library to render this image:</p><pre>#light<br /><br />open System.Windows.Media<br />open FlyingFrog.Graphics<br /><br />let pi = System.Math.PI<br /><br />let rotate t = RotateTransform(t / pi * 180.).Value<br /><br />let branches m =<br />  [ m * rotate(pi/2. - asin(4. / 5.)) * scale(4. / 5., 4. / 5.) *<br />      translate(0., 1.);<br />    m * translate(-1., 0.) * rotate(-pi/2. + asin(3. / 5.)) *<br />      scale(3. / 5., 3. / 5.) * translate(1., 1.) ]<br /><br />let line_loop xys = Contour.Closed [ for x, y in xys -> line_to x y ]<br /><br />let square = line_loop [1., 0.; 1., 1.; 0., 1.; 0., 0.]<br /><br />let shape brush m =<br />  Shape([ Interior brush;<br />          Stroke(Brushes.DarkGreen, { width = 0.01 }) ],<br />        [ Contour.map (fun p -> p * m) square ])<br /><br />let trunks brush ms = Group(List.map (shape brush) ms)<br /><br />let rec tree n ms =<br />  if n=0 then [trunks Brushes.Green ms] else<br />    let ms' = List.collect branches ms<br />    trunks Brushes.BurlyWood ms :: tree (n-1) ms'<br /><br />do<br />  let view = View(Group[])<br />  for n = 1 to 12 do<br />    view.Scene <- Group(tree n [Matrix.Identity])<br />  Run()<br /></pre><br /><p><a href="http://www.ffconsultancy.com/tmp/PythagorasTree.exe">Download and run the demo!</a>.</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-2003297956492388507?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com2tag:blogger.com,1999:blog-3752573690854836522.post-62048973682034016362009-05-21T11:45:00.004Z2009-05-21T12:10:48.350ZF# 1.9.6.16 released<p>Don Syme has announced the <a href="http://blogs.msdn.com/dsyme/archive/2009/05/20/visual-studio-2010-beta1-with-f-is-now-available-plus-matching-f-ctp-update-for-vs2008.aspx">release of a new version of F#</a> that replaces the old F# September 2008 CTP. This new release brings F# much more into alignment with the rest of .NET 4, in preparation for the first full product release of F# in Visual Studio 2010. The release is available either as part of the latest Visual Studio 2010 beta or as a separate F# May 2009 CTP that works with Visual Studio 2008.</p><p>Many of the improvements in the new version of F# are breaking changes that require existing software to be updated, such as the renaming of basic functions. For example, the <span style="font-family:courier new;">List.fold_right</span> function from OCaml has been renamed <span style="font-family:courier new;">List.foldBack</span>. We are in the process of bringing our <a href="http://www.ffconsultancy.com/products/fsharp_for_visualization/?fsb">F# for Visualization</a> and <a href="http://www.ffconsultancy.com/products/fsharp_for_numerics/?fsb">F# for Numerics</a> libraries up to date with respect to the latest F# CTP. Our forthcoming book <a href="http://www.ffconsultancy.com/products/fsharp_for_technical_computing/?fsb">F# for Technical Computing</a> will not only cover the latest version of F# but also all of the latest library versions and new techniques for integration and interoperability.</p><p> </p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-6204897368203401636?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com1tag:blogger.com,1999:blog-3752573690854836522.post-63691875810559234902009-05-21T00:02:00.004Z2009-05-21T00:07:05.154ZF# for Numerics 0.1.0.0 released<p><a href="http://www.ffconsultancy.com/products/fsharp_for_numerics/?fsb">F# for Numerics</a> 0.1.0.0 has just been released. This includes a wealth of new features and improvements such as:</p><ul><li>Numerical integration.</li><li>Bessel functions.</li><li>Skewness and kurtosis.</li><li>Series: natural numbers, Fibonacci, primes.</li><li>Seeding of Mersenne Twister with a <span style="font-family:courier new;">uint32</span>.</li><li>Constants: <span style="font-family:courier new;">epsilon_float32</span> and <span style="font-family:courier new;">delta32</span>.</li></ul><p>Subscribe to our beta release scheme today!</p><p> </p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-6369187581055923490?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-88601099349136296522009-05-20T13:32:00.002Z2009-05-20T13:35:10.544ZF# for Visualization 0.3.2.1 released<p><a href="http://www.ffconsultancy.com/products/fsharp_for_visualization/?fsb">F# for Visualization</a> 0.3.2.1 has just been released. This includes bug fixes, performance improvements and new examples.</p><p> </p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-8860109934913629652?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-2238978068192663882009-05-20T12:06:00.001Z2009-05-20T12:08:45.352ZPurely functional data structures: real-time queues and catenable lists<p><a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb51">The F#.NET Journal</a> just published an article about data structures:</p><p><em>"This is the second article in a series describing the design and implementation of some purely functional data structures. Real-time queues and catenable lists that provide reliable O(1) time complexity operations are described in detail. In particular, laziness is used to ensure that operations are performed efficiently even when the data structures are used persistently. This culminates in the creation of some useful new data structure implementations...."</em></p><p>To read this article and more, subscribe to <a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb51">The F#.NET Journal</a> today!</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-223897806819266388?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-6589348347334979362009-05-11T02:19:00.004Z2009-05-11T02:27:44.740ZNice F# screencast by Jason Olson<p>Jason Olson has done a great <a href="http://channel9.msdn.com/shows/10-4/10-4-Episode-17-F-Intro/">beginners introduction to F#</a> in the form of a video of him walking the viewer through F# using an interactive session.</p><p>In particular, Jason explains many of the basic features of the F# language that surprise beginners who have never seen an interactive statically-typed functional programming language before. This is recommended viewing for anyone struggling with basic features like patterns and curried functions.</p><p> </p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-658934834733497936?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-43595819967402395612009-05-07T01:15:00.007Z2009-05-07T02:23:01.465ZF# as a next-generation platform for high-performance interactive technical computing<p>We are now in the throws of writing a new book on F# called F# for Technical Computing that is due out in a few months. Amongst other things, we are generating diagrams for the book using our own <a href="http://www.ffconsultancy.com/products/fsharp_for_visualization/?fsb">F# for Visualization</a> library and making extensive use of our <a href="http://www.ffconsultancy.com/products/fsharp_for_numerics/?fsb">F# for Numerics</a> library and Microsoft's excellent <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=348F73FD-593D-4B3C-B055-694C50D2B0F3&displaylang=en">Parallel Extensions to .NET Framework 3.5 June 2008 CTP</a> in order to build a next-generation platform for high-performance interactive technical computing.</p><p>The following screenshot shows the real-time visualization of performance measurements over the array, list and set data structure implementations provided with the F# September 2008 CTP:</p><br /><p><a href="http://1.bp.blogspot.com/_NMRkpon4Ps0/SgI55NDcCrI/AAAAAAAAADQ/_V-VdHPVsdE/s1600-h/graphs.jpg"><img id="BLOGGER_PHOTO_ID_5332888563679496882" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 250px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_NMRkpon4Ps0/SgI55NDcCrI/AAAAAAAAADQ/_V-VdHPVsdE/s400/graphs.jpg" border="0" /></a></p><br /><p>There are several interesting aspects to this F# program:</p><ul><li>Individual benchmarks for a given data structure are executed in parallel in order to obtain results faster without artificially degrading the measurements for other data structures via GC load.</li><li>The parallelism is so effective that 90% CPU usage is sustained across all 8 cores.</li><li>Parallel threads update the visualizations concurrently in real time safe in the knowledge that <a href="http://www.ffconsultancy.com/products/fsharp_for_visualization/?fsb">F# for Visualization</a> handles all thread-related issues automatically and efficiently.</li><li>The randomized algorithms in the benchmarks are fuelled by the high-performance Mersenne Twister implementation in our <a href="http://www.ffconsultancy.com/products/fsharp_for_numerics/?fsb">F# for Numerics</a> library.</li><li>The entire program is under 80 lines of code.</li><li>The resulting high-fidelity diagrams are ideal for inclusion in quality printed literature such as our full-color books.</li></ul><p>Here is the entire source code:</p><pre>open FlyingFrog<br />open FlyingFrog.Graphics<br />open FlyingFrog.Graphics.Typeset<br />let log2 x =<br /> log x / log 2.0<br />let plot_mem =<br /> Plot([], (0., 20.), (-25., 0.0),<br /> Labels=(Char 'n', Sub(Char 't', Text "mem")))<br />let plot_mem_rel =<br /> Plot([], (0., 20.), (0., 20.0),<br /> Labels=(Char 'n', Fraction(Sub(Char 't', Text "set"), Sub(Char 't', Text "array"))))<br />let plot_iter =<br /> Plot([], (0., 20.), (-30., -20.0),<br /> Labels=(Char 'n', Sub(Char 't', Text "iter")))<br />let plot_foldl =<br /> Plot([], (0., 20.), (-30., -20.0),<br /> Labels=(Char 'n', Sub(Char 't', Text "foldl")))<br />let plot_foldr =<br /> Plot([], (0., 20.), (-30., -20.0),<br /> Labels=(Char 'n', Sub(Char 't', Text "foldr")))<br />let tss =<br /> [for plot in 1 .. 4 -><br /> [for i in 1 .. 3 -><br /> [for i in 0 .. 101 -> float i, infinity]]]<br />let iters = 4001<br />let inline time f n m =<br /> let rand = Random.MersenneTwister()<br /> let t = System.Diagnostics.Stopwatch.StartNew()<br /> let mutable j = 0<br /> while t.ElapsedMilliseconds < 100L do<br /> for k=0 to j do<br /> f (abs(rand.int()) % n) m<br /> j <- j + 1 float t.ElapsedMilliseconds / 1e3 / float j<br />let inline run d f mem iter foldl foldr =<br /> System.Threading.Parallel.For(0, iters, fun i' -><br /> let i = iters * i' % 101<br /> let n = 2. ** (float i / 100. * 20.) > int<br /> let m = f n<br /> let t' = time mem n m > log2<br /> if snd tss.[0].[d].[i] > t' then<br /> tss.[0].[d].[i] <- log2(float n), t'<br /> for f, tss in [iter, tss.[1]; foldl, tss.[2]; foldr, tss.[3]] do<br /> let t' = (time f n m / float n) > log2<br /> if snd tss.[d].[i] > t' then<br /> tss.[d].[i] <- log2(float n), t'<br /> if i' % 100 = 0 then<br /> plot_mem.Data <- [for ts in tss.[0] -> Data ts]<br /> plot_mem_rel.Data <-<br /> [Data(Array.map2 (fun (i, ts) (_, ta) -> i, 2. ** ts / 2. ** ta)<br /> tss.[0].[0] tss.[0].[2])]<br /> plot_iter.Data <- [for ts in tss.[1] -> Data ts]<br /> plot_foldl.Data <- [for ts in tss.[2] -> Data ts]<br /> plot_foldr.Data <- [for ts in tss.[3] -> Data ts]<br /> )<br />let inline array_mem x (a: _ array) =<br /> let rec aux i =<br /> i < Array.length a && (a.[i] = x aux(i+1))<br /> aux 0<br />do<br /> run 2 (fun n -> Array.init n (fun i -> float i))<br /> (fun n m -> ignore(array_mem (float n) m))<br /> (fun n m -> Array.iter ignore m)<br /> (fun n m -> Array.fold_left ( + ) 0.0 m > ignore)<br /> (fun n m -> Array.fold_right ( + ) m 0.0 > ignore)<br /> run 0 (fun n -> set (seq {for i in 0 .. n-1 -> float i}))<br /> (fun n m -> ignore(Set.mem (float n) m))<br /> (fun n m -> Set.iter ignore m)<br /> (fun n m -> Set.fold_left ( + ) 0.0 m > ignore)<br /> (fun n m -> Set.fold_right ( + ) m 0.0 > ignore)<br /> run 1 (fun n -> [for i in 0 .. n-1 -> float i])<br /> (fun n m -> ignore(list_mem (float n) m))<br /> (fun n m -> List.iter ignore m)<br /> (fun n m -> List.fold_left ( + ) 0.0 m > ignore)<br /> (fun n m -> List.fold_right ( + ) m 0.0 > ignore)<br />Run()</pre><pre> </pre><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-4359581996740239561?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com1tag:blogger.com,1999:blog-3752573690854836522.post-84315366789462401432009-05-04T17:27:00.003Z2009-05-04T17:41:47.715ZRe: Microsoft canning F#<p>We went to Cambridge to meet Don Syme last week and attended a great lecture by Tom Wickham-Jones from <a href="http://www.wolfram.com">Wolfram Research</a>. I spoke to Don about the concerns among some of our customers regarding the future of F# and he assured me that they are focused entirely on forthcoming releases with a schedule that spans years. The next release, beta 1, is due out <span style="font-style: italic;">this month</span> and a beta 2 is scheduled for release <span style="font-style: italic;">before</span> the full 2010 release next year.</p><p><br /></p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-8431536678946240143?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com2tag:blogger.com,1999:blog-3752573690854836522.post-20212590226217371842009-05-04T03:08:00.003Z2009-05-04T03:11:35.079ZPurely functional data structures: streams and batched queues<p><a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb50">The F#.NET Journal</a> just published an article about data structures:</p><p><em>"This article is the first in a series describing the design and implementation of some very useful purely functional data structures. Lazy evaluation, lazy streams and batched queues are described in detail. In particular, new .NET interfaces, classes and objects are used factor the implementations of the data structures and various built-in interfaces are implemented in order to support equality, comparison and hashing of these new data structures...."</em></p><p>To read this article and more, subscribe to <a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb50">The F#.NET Journal</a> today!</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-2021259022621737184?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-12970561527394548942009-04-19T23:22:00.003Z2009-04-20T00:33:59.754ZMassive savings on F# for Visualization and F# for Numerics<p>We just slashed the price of source code licenses for our <a href="http://www.ffconsultancy.com/products/fsharp_for_visualization/?fsb">F# for Visualization</a> and <a href="http://www.ffconsultancy.com/products/fsharp_for_numerics/?fsb">F# for Numerics</a> libraries.</p><p><a href="http://www.ffconsultancy.com/products/fsharp_for_visualization/?fsb">F# for Visualization</a> augments <a href="http://www.ffconsultancy.com/products/fsharp_journal/">F#</a> with graphing and visualization capabilities that can be used directly from <a href="http://www.ffconsultancy.com/products/fsharp_journal/">F#</a> interactive sessions running in Visual Studio itself, as well as WPF Controls that can be used in your own standalone programs. Plot <a href="http://www.ffconsultancy.com/products/fsharp_for_visualization/demo4.html">2D functions</a> and <a href="http://www.ffconsultancy.com/products/fsharp_for_visualization/demo2.html">3D functions</a>, <a href="http://www.ffconsultancy.com/products/fsharp_for_visualization/demo1.html">3D objects</a> and <a href="http://www.ffconsultancy.com/products/fsharp_for_visualization/demo5.html">embed the visualization capabilities</a> in your own programs with our reusable Windows Presentation Foundation controls. Read the full documentation <a href="http://www.ffconsultancy.com/products/fsharp_for_visualization/docs/namespaces.html">here</a>.</p><p><a href="http://www.ffconsultancy.com/products/fsharp_for_numerics/?fsb">F# for Numerics</a> provides a wide variety of invaluable numerical methods with elegant <a href="http://www.ffconsultancy.com/products/fsharp_journal/">F#</a> interfaces that allow you to solve numerical problems quickly and easily from the comfort of <a href="http://www.ffconsultancy.com/products/fsharp_journal/">F#</a>, both interactively and in your own standalone programs. Read the full documentation <a href="http://www.ffconsultancy.com/products/fsharp_for_numerics/docs/namespaces.html">here</a>.</p><p> </p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-1297056152739454894?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-55955056311057800702009-04-16T00:58:00.002Z2009-04-16T01:01:32.265ZLempel-Ziv-Welch data compression<p><a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb49">The F#.NET Journal</a> just published an article about data compression:</p><p><em>"LZW is a simple and effective dictionary-based data compression algorithm originally published in 1984 and subsequently used in several prominent places including the GIF image format. This article describes simple purely-functional implementations of the compression and corresponding decompression algorithms before examining the translation and optimization of these algorithms into longer but more efficient imperative equivalents. In particular, F#'s sequence expressions are used extensively to create on-the-fly compressors and decompressors ideal for stream processing...."</em></p><p>To read this article and more, subscribe to <a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb49">The F#.NET Journal</a> today!</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-5595505631105780070?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-55644470523347815692009-04-08T17:02:00.005Z2009-04-08T17:11:46.025ZBook review: F# for Scientists<p>Mike Hadlow, a freelance .NET developer from Brighton England, recently wrote a <a href="http://mikehadlow.blogspot.com/2009/01/more-curry.html">review</a> of our book <a href="http://www.ffconsultancy.com/products/fsharp_for_scientists/?fsb">F# for Scientists</a>:</p><p></p><blockquote><p>"I read most of <a href="http://www.ffconsultancy.com/products/fsharp_for_scientists/?fsb">F# for Scientists</a> by Dr Jon Harrop over the Christmas holidays. Now, don’t be put of by the title, it’s a really wonderful little book. I’m no scientist, my undergraduate degree was a general social science pick and mix affair, but I found <em>most</em> of it straightforward. I had to skip some of the complex mathematics but that didn’t seem to hurt my appreciation of programming principles being discussed.</p><p>It’s really nice to find a small programming book. Far too many assume too little intelligence from the reader and waffle at length on trivial subjects. It doesn’t help that the IT profession seems to value its books by the killogram. Dr Harrop doesn’t suffer from either of these traits and is happy to introduce difficult subjects in a concise and direct style. Now that means that I sometimes had to spend a while on each page to make sure I understood it, but that’s far better than reading page after page of whatever for dummies.</p><p>If I’ve taken anything from this book, it’s a much better understanding of currying. I talked about it a while back when discussing <a href="http://mikehadlow.blogspot.com/2008/03/currying-in-c-with-oliver-sturm.html">an excellent presentation of functional C# by Oliver Sturm</a>, but at that time I hadn’t understood how central it was to understanding F#..."</p></blockquote><p>Thanks Mike!</p><p>Don't forget we are drawing upon the expertise we gained from the feedback about <a href="http://www.ffconsultancy.com/products/fsharp_for_scientists/?fsb">F# for Scientists</a> in our forthcoming book F# for Technical Computing that will cover all of the latest libraries including parallel and concurrent programming the F# way.<br /></p><p><br /></p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-5564447052334781569?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com3tag:blogger.com,1999:blog-3752573690854836522.post-70824232817165966112009-03-31T05:42:00.001Z2009-03-31T05:44:59.545ZAperiodic tilings<p><a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb48">The F#.NET Journal</a> just published an article about the generation and visualization of tilings using F#:</p><p><em>"Many sets of polygons can be used to tile an infinite 2D plane. The term "aperiodic tilings" is used informally to refer to tilings that are not periodic. Such tilings are not only of mathematical and scientific interest because they give rise to unexpected diffraction patterns when they appear in quasicrystalline materials but also because they are often beautiful and, consequently, have been used in ornamental decorations for centuries. This article describes a simple program that visualizes tilings using Windows Presentation Foundation where the tilings are described using generic rewrite rules implemented in terms of a .NET interface...."</em></p><p>To read this article and more, subscribe to <a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb48">The F#.NET Journal</a> today!</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-7082423281716596611?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0tag:blogger.com,1999:blog-3752573690854836522.post-30823406073183014852009-03-29T01:40:00.004Z2009-03-29T04:19:22.274ZRetraining? Consider F#...<p>I was just chatting with a friend who is a Microsoft certified trainer and he mentioned that the recession has boosted their turnover significantly as many people are earning new qualifications to in order to prepare themselves for today's highly-competitive hi-tech job market.</p><p>Employers have been quick to recognise that bleeding-edge programming languages like <a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb">F#</a> are an excellent way for them to identify the most motivated and intelligent applicants for a wide range of programming-related jobs.<br /></p><p>So why not put <a href="http://www.ffconsultancy.com/products/fsharp_journal/?fsb">F#</a> at the top of your list of languages to learn in 2009?<br /></p><p>Here are some resources to help you get started:</p><ul><li><a href="http://www.ffconsultancy.com/products/fsharp_journal/free/introduction.html?fsb">First article from the F#.NET Journal</a></li><li><a href="http://media.wiley.com/product_data/excerpt/16/04702421/0470242116.pdf">First chapter of F# for Scientists</a><br /></li><li><a href="http://cs.hubfs.net/">F# Hub discussion forums</a></li></ul><p><br /></p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3752573690854836522-3082340607318301485?l=fsharpnews.blogspot.com'/></div>Flying Frog Consultancy Ltd.http://www.blogger.com/profile/11059316496121100950noreply@blogger.com0