Microsoft brings F# to Visual Studio

The F# (F Sharp) Modern functional programming langauge may be uniquely well-suited for multicore environments.

The next version of the Visual Studio, Microsoft's integrated developer environment, will feature a new Microsoft-developed programming language called F# (F sharp). What makes F# different from other Visual Studio-supported languages is that it is what developers call a functional programming language.

Such an inclusion in Visual Studio 2010 signals a victory for this once-obscure branch of programming.

Although functional languages have been around for decades, they largely have been discarded in favor of traditional imperative languages, such as Java and C. Advocates claim, however, that functional languages run faster and take less time to develop once you know how to program in them.

Each year, the International Conference on Functional Programming (ICFP) holds a programming contest, in which the winners are picked by the how quickly their programs complete a given task. In most cases, functional programs such as Objective Caml and Haskell take the prize (last year's Java championship being an exception).

The increasing prevalence of multicore processors also bodes well for functional programming paradigm's future. To get the most from  multicore chips, programmers must cut their programs into smaller tasks so they can execute in parallel across multiple processor cores—an easy task in a functional environment.

Microsoft Research first developed F#. The idea was to develop a modern functional language that could work in a .NET environment, and would also share characteristics with the more commonly used imperative languages, notably Microsoft's C#.

At first glance, F# may seem like a foreign beast to most programmers. Traditional imperative languages create programs by establishing a set of values in memory, called a state, and then changing the state when necessary.

A functional language minimizes this state by forcing the programmer to write an application as a "composition of functions," explained Vlad Vinogradsky, a senior architect evangelist from Microsoft's public sector group. Functions "calculate a return value, and that is all that they do," he said. This approach assures that if a value is changed, it won't inadvertently change another part of the program (called a side-effect).

While F# is a complete functional language, it is not a pure functional language, Vinogradsky cautioned. It also borrows many characteristics from the standard imperative languages.

"You could describe F# as a multi-paradigm language. It supports object-oriented imperative programming, which a lot of people are used to. It does so in a syntax that would not be foreign to a C# or Java programmer. And at the same time, it also has all the features and facilities that one would expect from a functional language," Vinogradsky said.

The idea is to "introduce functional languages to people who have been working in object-oriented or other imperative languages," he added.

Although Microsoft has had a beta version of F# available for Visual Studio 2008 for some time, the first fully supported production ready version of the language will be included in Visual Studio 2010, expected to be released within the next year or so.

Like the other languages in Visual Studio, F# will be part of the .NET Common Language Runtime (CLR), a runtime framework shared among languages for executing programs on a Microsoft Windows computer. This will allow programmers to mix bits of code written in F# with those written in other .NET languages.

The language is being added as part of an overall effort to expand the range and types of languages that can be used within Visual Studio and the .NET framework, Vinogradsky said. F# in Visual Studio will have most of the features that C# and Visual Basic have long enjoyed, such as debugging and auto-completion.

Given that the learning curve for this language is not inconsiderable, what sorts of projects would make using F# worthwhile? This language would work very well for complex algorithmic processes, such as data mining, according to Vinogradsky.

Programs that must undertake a lot of complex mathematical calculations would also work well in F#, since the language so closely mimics standard mathematical procedures. Like Sun Microsystem's Fortress, F# could also replace the long-in-the-tooth Fortran, which is now widely used by scientists for heavy numerical calculations.

F# also works very well in parallel environments.

"The interest in functional languages is surging right now, I think, primarily due to interest in concurrent programming, what with multicore chips coming out," Vinogradsky said. Functional languages are uniquely suited for working in environments with many processors, or multicore processors.

Since the functional approach minimizes the global state of a running program, it allows the program to be easily separated in parallel operations. "Each function is independent, so it is very easy to change without any side-effects," he said.

Vinogradsky agreed that F# would not be applicable for many applications; it is another tool in the arsenal that Microsoft offers developers. The company "is trying to provide choice for developers, so they can pick the right tools for the job," he said.

NEXT STORY: House introduces nanotech bill

X
This website uses cookies to enhance user experience and to analyze performance and traffic on our website. We also share information about your use of our site with our social media, advertising and analytics partners. Learn More / Do Not Sell My Personal Information
Accept Cookies
X
Cookie Preferences Cookie List

Do Not Sell My Personal Information

When you visit our website, we store cookies on your browser to collect information. The information collected might relate to you, your preferences or your device, and is mostly used to make the site work as you expect it to and to provide a more personalized web experience. However, you can choose not to allow certain types of cookies, which may impact your experience of the site and the services we are able to offer. Click on the different category headings to find out more and change our default settings according to your preference. You cannot opt-out of our First Party Strictly Necessary Cookies as they are deployed in order to ensure the proper functioning of our website (such as prompting the cookie banner and remembering your settings, to log into your account, to redirect you when you log out, etc.). For more information about the First and Third Party Cookies used please follow this link.

Allow All Cookies

Manage Consent Preferences

Strictly Necessary Cookies - Always Active

We do not allow you to opt-out of our certain cookies, as they are necessary to ensure the proper functioning of our website (such as prompting our cookie banner and remembering your privacy choices) and/or to monitor site performance. These cookies are not used in a way that constitutes a “sale” of your data under the CCPA. You can set your browser to block or alert you about these cookies, but some parts of the site will not work as intended if you do so. You can usually find these settings in the Options or Preferences menu of your browser. Visit www.allaboutcookies.org to learn more.

Sale of Personal Data, Targeting & Social Media Cookies

Under the California Consumer Privacy Act, you have the right to opt-out of the sale of your personal information to third parties. These cookies collect information for analytics and to personalize your experience with targeted ads. You may exercise your right to opt out of the sale of personal information by using this toggle switch. If you opt out we will not be able to offer you personalised ads and will not hand over your personal information to any third parties. Additionally, you may contact our legal department for further clarification about your rights as a California consumer by using this Exercise My Rights link

If you have enabled privacy controls on your browser (such as a plugin), we have to take that as a valid request to opt-out. Therefore we would not be able to track your activity through the web. This may affect our ability to personalize ads according to your preferences.

Targeting cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising.

Social media cookies are set by a range of social media services that we have added to the site to enable you to share our content with your friends and networks. They are capable of tracking your browser across other sites and building up a profile of your interests. This may impact the content and messages you see on other websites you visit. If you do not allow these cookies you may not be able to use or see these sharing tools.

If you want to opt out of all of our lead reports and lists, please submit a privacy request at our Do Not Sell page.

Save Settings
Cookie Preferences Cookie List

Cookie List

A cookie is a small piece of data (text file) that a website – when visited by a user – asks your browser to store on your device in order to remember information about you, such as your language preference or login information. Those cookies are set by us and called first-party cookies. We also use third-party cookies – which are cookies from a domain different than the domain of the website you are visiting – for our advertising and marketing efforts. More specifically, we use cookies and other tracking technologies for the following purposes:

Strictly Necessary Cookies

We do not allow you to opt-out of our certain cookies, as they are necessary to ensure the proper functioning of our website (such as prompting our cookie banner and remembering your privacy choices) and/or to monitor site performance. These cookies are not used in a way that constitutes a “sale” of your data under the CCPA. You can set your browser to block or alert you about these cookies, but some parts of the site will not work as intended if you do so. You can usually find these settings in the Options or Preferences menu of your browser. Visit www.allaboutcookies.org to learn more.

Functional Cookies

We do not allow you to opt-out of our certain cookies, as they are necessary to ensure the proper functioning of our website (such as prompting our cookie banner and remembering your privacy choices) and/or to monitor site performance. These cookies are not used in a way that constitutes a “sale” of your data under the CCPA. You can set your browser to block or alert you about these cookies, but some parts of the site will not work as intended if you do so. You can usually find these settings in the Options or Preferences menu of your browser. Visit www.allaboutcookies.org to learn more.

Performance Cookies

We do not allow you to opt-out of our certain cookies, as they are necessary to ensure the proper functioning of our website (such as prompting our cookie banner and remembering your privacy choices) and/or to monitor site performance. These cookies are not used in a way that constitutes a “sale” of your data under the CCPA. You can set your browser to block or alert you about these cookies, but some parts of the site will not work as intended if you do so. You can usually find these settings in the Options or Preferences menu of your browser. Visit www.allaboutcookies.org to learn more.

Sale of Personal Data

We also use cookies to personalize your experience on our websites, including by determining the most relevant content and advertisements to show you, and to monitor site traffic and performance, so that we may improve our websites and your experience. You may opt out of our use of such cookies (and the associated “sale” of your Personal Information) by using this toggle switch. You will still see some advertising, regardless of your selection. Because we do not track you across different devices, browsers and GEMG properties, your selection will take effect only on this browser, this device and this website.

Social Media Cookies

We also use cookies to personalize your experience on our websites, including by determining the most relevant content and advertisements to show you, and to monitor site traffic and performance, so that we may improve our websites and your experience. You may opt out of our use of such cookies (and the associated “sale” of your Personal Information) by using this toggle switch. You will still see some advertising, regardless of your selection. Because we do not track you across different devices, browsers and GEMG properties, your selection will take effect only on this browser, this device and this website.

Targeting Cookies

We also use cookies to personalize your experience on our websites, including by determining the most relevant content and advertisements to show you, and to monitor site traffic and performance, so that we may improve our websites and your experience. You may opt out of our use of such cookies (and the associated “sale” of your Personal Information) by using this toggle switch. You will still see some advertising, regardless of your selection. Because we do not track you across different devices, browsers and GEMG properties, your selection will take effect only on this browser, this device and this website.