Welcome to MSDN Blogs Sign in | Join | Help

F# and ArcGIS/ArcObjects

Ray Vernagus has posted an introduction to using F# with ArcGIS through ArcObjects

One of the things I like most about F# is how it allows typed functional programming to be applied to data-rich domains such as Machine Learning, Computer Aided Design (CAD) and Geographical Information Systems (GIS). GIS is of particular interest to me as I learned a lot about this area back in my undergraduate days, and because of the ever-enduring appeal of maps and simulation. Like Kean Wamsley's F# and AutoCAD examples, it's just amazing how easy it is to get going with F# and ArcInfo.

Ray also has a few other useful posts:

Easy Testing in F#

Functional Programming Patterns

Purely Functional Data Structures: an F# Stack

Purely Functional Data Structures: An F# Binary Tree

and a useful update to a code sample in Expert F#:

Kill That Annoying Flicker

 

 

 

 

 

Help with study of functional programmers

Are you currently developing or maintaining a medium to large-sized program written in a functional language, such as Haskell, F#, OCaml, or Lisp?  Chris Bogart is a PhD student doing a study of functional programmers, as part of a research internship at Microsoft, and would like the opportunity to look over your shoulder while you do debugging or coding on your project. Here's what he says:

I'm looking for people with at least a year's experience doing functional programming, and who are currently working on a real project (i.e. for some purpose other than learning functional programming).  I'm only allowed to use people who can work in the US (because of the gratuity, which is taxable income). I'd simply come watch you work, and ask a few questions along the way. You'd do whatever you would normally be doing.  If you're near Seattle or Portland, I'd come to your office for a couple of hours.  If you're not near Seattle or Portland, then we'd set you up with LiveMeeting or some other remote screencast software so I can watch you from here.

Obviously security concerns are an issue - I will not share any proprietary information that I learn about while visiting you.

In exchange for your help, Microsoft will offer you your pick of free software off its gratuity list (which has about 50 items, including Visual Studio Professional, Word for Mac, XBOX 360 games) or any book from MS Press.

We're doing this because expert functional programmers have not been studied much.  We plan to share our findings through academic publications, to help tool developers create debugging tools that are genuinely helpful in real-world settings.

I'm hoping to finish my observations by August 8th, so please contact me immediately if you're interested!

Thank you,

Chris Bogart
425-538-3562
t-chribo@microsoft.com

Posted by dsyme | 1 Comments
Filed under:

1.9.4.19 release

We've posted a minor update to version 1.9.4 (called 1.9.4.19). The change notice is in the README and below. There are three fixes/changes in this release

Ø There was a glitch that prevented F# version 1.9.4.17 programs working well on Mono. A workarounds was mentioned here http://laurent.le-brun.eu/site/index.php/2008/06/05/36-how-to-use-fsharp-1-9-4-17-on-mono, though this workaround should now no longer be needed.

Ø  WebRequest.GetResponseAsync has been removed from FSharp.Core.dll, to help allow F# programs to be used on SIlverlight and other platforms where this method either doesn’t exist or is in a non-standard place. See the release notes if you need this method (for example, it is needed for some examples in Expert F#)

Ø  We have fixed a compiler problem related to .NET 3.5 SP1 Beta (“strange entry in exported types table”)

http://research.microsoft.com/research/downloads/Details/7ac148a7-149b-4056-aa06-1e6754efd36f/Details.aspx (MSI)

http://research.microsoft.com/research/downloads/Details/6f48a466-4294-4973-9e15-25e0ddff422f/Details.aspx (ZIP)

Thanks

Don

 

F# On Mono

  • The Mono 2.0 profile for F# is now used. On Mono the F# compiler is now invoked using mono bin\fscp.exe. See the notes above for details of this. NOTE: compiler startup times may be reduced on Mono because the Mono 1.9 doesn't support 'Ahead of Time Compilation' for its 2.0 profile. This won't normally be a problem if you're only using F# Interactive (fsi.exe). If it is a problem then see the instructions above for using the .NET 1.x profile compiler.

Library

  • WebRequest.GetResponseAsync now removed from the F# library since its use of a System.Net method makes FSharp.Core.dll unusable on some .NET platforms. To use this method use:

        type System.Net.WebRequest with

            member x.GetResponseAsync() =

                Async.BuildPrimitive(x.BeginGetResponse, x.EndGetResponse)

Bugs fixed

2033    F# Compiler doesn't work with type forwarders found in .NET Framework 3.5 SP 1 Beta1

Updated Specification for the 1.9.4 "Spring Refresh" Release

I've just updated the links on the F# manual pages to point to the updated draft language specification (one big HTML page, or PDF) for the 1.9.4 release.

This is a major revision of the old spec to cover much of the language work done in the 1.9.4 release. It's from us at Microsoft Research, so isn't an "official" Microsoft spec.

This includes some comments from the F# team and some working notes.

Enjoy!

Don

 

High Performance Computing with F# and MPI

Matthew has written a great guide getting going with MPI on .NET, using F#. Here's an excerpt:

In my previous post, I looked at some of the options we have for concurrency programming in .NET applications.  One of the interesting ones, yet specialized is the Message Passing Interface (MPI).  Microsoft made the initiative to get into the high performance computing space with the Windows Server 2003 Compute Cluster Server SKU.  This allowed developers to run their given algorithms using MPI on a massive parallelized scale.  And now with the Windows Server 2008 HPC SKU, it is a bit improved with WCF support for scheduling and such.  If you're not part of the beta and are interested, I'd urge you to go through Microsoft Connect.  ...

Posted by dsyme | 1 Comments

"F# for Numerics" released

Flying Flog Consulting have recently published F# for Numerics. Here's how they describe the library:

Our new F# for Numerics library is a suite of numerical methods that leverage functional programming with F#...

This library implements numerical methods from a variety of different disciplines in a uniform way ...:

  • Local and global function minimization and maximization.
  • Mean, median, mode, variance, standard deviation, skew, kurtosis, Shannon entropy and other statistical quantities.
  • Interpolation, curve fitting and regression.
  • Matrix factorizations including eigenvalue computation.
  • Numerical integration and differentiation.
  • Spectral methods including the Fast Fourier Transform.

The first update has reportedly added:

  • FFTs now 2× faster.
  • 1D FFTs over both arrays and vectors.
  • 2D FFTs over F# matrices with parallelism to exploit multicores.
  • Linear, cubic spline and Lagrange polynomial interpolation.
  • More special functions including sinc, the error function and the probit function.
  • Faster Mersenne Twister random number generation, particularly over the Normal distribution.
  • Physical constants.
  • More worked examples.
  • The binomial function for combinatorics.

Some F# Jobs

After a post on Planet F#, I looked around for 5 minutes and here are a few high-paying jobs where F# skills are a "major plus"

Enjoy!

Don

 

Posted by dsyme | 1 Comments
Filed under:

From Script to .NET Component: Huffman Coding with F#

Luke Hoban has a very nice blog entry that shows an implementation of Huffman Coding with F#. This not only shows of F# as an algorithmic problem-solving language, but, just as importantly, shows just how elegant and smooth it is to take this code and produce a .NET object-oriented component that encapsulates a Huffman encoder for use from other .NET languages.

Beautiful. Just beautiful.

 

F# Talks at TechDays in Paris: Slides and Videos

It's taken me a while, but I've finally posted the slides from the two talks I gave at TechDays in Paris

Videos are also available

Enjoy!

Don

Learning F#: Some great blog posts from the F# team

Brian and Chris have been writing some great blog posts of late on learning F#. I can highly recommend these ones in particular:

Enjoy!

Don

Posted by dsyme | 1 Comments
Filed under:

F# 1.9.4 Now Available: Making F# Simpler and More Consistent

 [ Note: we have made a minor update to 1.9.4 called 1.9.4.19. The download links below point to this release. If you need 1.9.4.17 go to our downloads page. ]

 

 [ Note: download links updated to point to the MSI correctly ]

 

We're very glad to announce the release of F# 1.9.4, the Spring Refresh of F#, uploaded to the Microsoft Research download site yesterday! (MSI download, ZIP, detailed release notes) (Ok, ok, apologies to our antipodean users where it’s actually autumn... In any case, on with the show!)

 

This release of F# has much the same shape and form as earlier releases of F# from MSR. As I hinted in April, our focus for this release has been on polishing and simplifying the language and libraries, particularly with regard to making certain details more regular and consistent. Much of this has been driven by user feedback, and we'd like to say a big thank you to for all the feedback we've got from hubFS users, the F# list, F# users at Microsoft and our growing number of commercial users, particularly our friends at the financial institutions using F#. Also a thank you to those community members who helped us by installing early releases of this version.

 

Some of the highlights of the language streamlining we've done in this release include

  • More consistent, symmetric operator overloading
  • Use named and optional arguments in conjunction with COM methods (gives simpler use of Excel, Word APIs etc.)
  • Additional nullness checking
  • Completing the object model (sealed, abstract class attributes and many other details have been addressed)
  • Performance optimizations in the F# core library
  • Improvements to the F# Interactive Window in Visual Studio
  • Over 100 bug fixes , many based on user feedback

Addressing items like these go a long way to transitioning the language into a stabilized, productization mode. Our overall goals, as always, are to integrate the succinctness, efficiency, expressivity of typed functional programming into the foundational set of tools that people use as part of .NET programming, while ensuring that language is simple-to-use and has great tool support.

 

The detailed release notes can be found here. This release doesn't include many of the investments we've been making in Visual Studio tools - we'll be rolling those out over the rest of the year as we move into CTP and beynd.

 

There have been numerous changes and enhancements in this release, documented below. These may cause you to see additional deprecation warnings or errors. We’d be particularly grateful if you could report any compilation failures, and if possible reduce them to a minimal repro for us.

 

Many thanks & enjoy your F# work!

 

Don, James, Luke, Brian, Jomo, Chris, Matteo, Santosh and Laurent

 

F# at TechEd Israel

Luke Hoban will be presenting F# at TechEd Israel in a couple of days time. Enjoy!

 

Posted by dsyme | 0 Comments

Tackling the F# Productization

Over the last few months the F# team has been diving deep into the technical work needed to productize F#. In this post I'd like to give a bit of a picture for what that means and how the team has been ramping up on our work.

Firstly, the team! In Cambridge we have myself and James Margetson, and in Redmond we have Luke Hoban, Jomo Fisher, Brian McNamara, Chris Smith, Matteo Taveggia and Santosh Zachariah, with help from Raj Pai, Yasir Alvi, Shri Borde, Dmitry Robsman and Mike Hopcroft who lead up various disciplines (QA, Dev, Program Management) within teams dealing with several .NET languages.

So, what does "productizing F#" really mean? As a language, F# is certainly staying much like it is now: succinct, efficient, expressive, simple-to-use and with good tool support. Fundamentally, productization means more of the same, only better :-) 

At a more concrete level, over the next few weeks we plan to roll out the April Update to the Microsoft Research Release of F#. This release will :

  • contain over 100 bug fixes and feature completions to the core F# language
  • address some language design issues that we'd been putting off for some time
  • be matched by a draft of the F# Language Specification

I've greatly enjoyed working on this release: we've addressed many of the niggling issues that researchers tend to ignore ("Conditional compilation?" Yes! "assert calls System.Diagnostics.Assert?" Naturally! "Why doesn't typeof<_> work in an attribute?" Well, it will now!) . I'll follow up with more details as we make the release. At this point I want to also say a huge thank you to all those on www.hubFS.net and the F# List who've been so active in reporting issues and helping us really improve the quality of what we have. The F# user community are consistently helpful, friendly and well-informed, and are one of the main reasons why I find working on this language so enjoyable.

Looking beyond that release, Brian McNamara has written up a short summary of our plans for a CTP (Community Technology Preview) this summer and what that is likely to contain. The main features he lists are:

  • Runtime components:
    • fsc.exe, the compiler that knows the F# language
    • fsi.exe, the interactive command environment
    • the F# libraries (usual stuff, ranging from immutable lists to asynchronous computations library)
    • an msbuild task which lets you build an F# ".fsproj" project from the command line
  • Design-time components (Visual Studio 2008 integration):
    • F# language service, which provides syntax highlighting, intellisense, tooltips, etc.
    • F# project system, which enables you to add/remove .fs files, reference dlls, etc.
    • F# interactive window, where fsi is hosted inside Visual Studio

You'll be able to use all this in conjunction by composing these components with versions of Visual Studio such as the freely-available Visual Studio 2008 Shell or with Visual Studio 2008 itself. One of the things we've been investing in heavily is to have Jomo and Brian tackle the job of putting the F# design-time components on a sound engineering footing. This means we're no longer basing the Visual Studio components on the old MyC C++ sample, which was useful originally but had many problems too. Instead we're using VSX (Visual Studio extensibility) available in the Visual Studio SDK.  

So, it's shaping up to be a wonderful year for F#. There's lots of work for us to do, but I'm trust you'll agree it's worth it!

 

Kean Walmsley on using F# Asynchronous Workflows to simplify concurrent programming in AutoCAD

On Friday Kean Walmsley posted an excellent article on Using F# Asynchronous Workflows to simplify concurrent programming in AutoCAD.I've quoted some it below.

There are two things I especially like about this post. First, Kean's code is very clean and some of the best F# app-extension scripting I've seen.

Second, Kean took the time to highlight the minor differences between the synchronous and parallel versions of his algorithm. Of the 235 lines, only 13 lines of code and 7 lines of comments changed, and even for those there is a very close correspondence between the versions. Allowing programmers to achieve this correspondence was one of the key design goals of asynchronous workflows.

Here are some snippets from Kean:

As promised, in today's post we take that code and enable it to query the same data in parallel by using Asynchronous Workflows in F#. Asynchronous Workflows are an easy-to-use yet powerful mechanism for enabling concurrent programming in F#.

Firstly, a little background as to why this type of technique is important. ... Barring some disruptive technological development, the future gains in computing performance are to be found in the use of parallel processing, whether via multiple cores, processors or distributed clouds of computing resources. ... Additionally, with an increasing focus on distributed computing and information resources, managing tasks asynchronously becomes more important...

The big problem is that concurrent programming is - for the most-part - extremely difficult to do, and even harder to retro-fit into existing applications...

 Today's post looks at a relatively simple scenario, in the sense that we want to perform a set of discrete tasks in parallel, harnessing those fancy multi-core systems for those of you lucky enough to have them (I'm hoping to get one when I next replace my notebook, sometime in March)...

We are also going to be very careful only to run parallel tasks unrelated to AutoCAD. Any access made into AutoCAD's database, for instance, needs to be performed in series: AutoCAD is not thread-safe when it comes to the vast majority of its programmatically-accessible functionality. So we're going to run a set of asynchronous, parallel tasks to query our various RSS feeds, and combine the results before creating the corresponding geometry in AutoCAD. This all sounds very complex, but the good (actually great) news is that Asynchronous Workflows [do] all the heavy lifting....

In an earlier post I linked to Kean's entries where he had written his first AutoCAD application using F# and has just followed up with A mathematical F# application integrating with AutoCAD via .NET which embeds one of the F# DirectX demos directly into AutoCAD.

 

More Posts Next page »
 
Page view tracker