Welcome to MSDN Blogs Sign in | Join | Help

A Taste of F# Interactive in Visual Studio

Here's a taste of some great new functionality that will be in the next release of F#, which we should have out sometime in the next week or so. The cool thing here is not just the pretty graphics (which you've been able to do in F# for a while now), but F# Interactive (fsi.exe) embedded as a tool window in Visual Studio. Click on the screen shot for an enlargement.

 

Also shown is something I haven't made much noise about on this blog, and that's the ability to display windows interactively from F# Interactive.  The windows are fully active - they can paint and respond to interactions while the programmer evaluates new expressions, code, types and classes in the interactive session.  You can also dynamically load new .NET components on-the-fly.

At the bottom of the screen you'll see a tool window containing the F# Interactive session. The WinForms/DirectX window in the foreground was created by running simple F# code such as

let form = new Form();;
form.Text <- "F# surface plot";;

as well as some introductory DirectX triangle creation. 

The code shown in the editor is part of this script - we've just executed the command that specifies a new function to display (this is the line highlighted in the editor).  We did this just by evaluating the code in the F# Interactive Session below using a key short-cut.  (I've scrolled the F# Interactive window back up to the top so you can see the banner printed out when F# Interactive starts up.)

What's really striking is the combination of interactive visualization, Visual Studio, .NET programming and efficiently executing F# code (remember, .the floating point code is running as optimized native code, often close to C++ speed).  We have a few things to add before this is complete: for example some form of intellisense in the interaction window.  But this combination feels like it is bringing many things together nicely.  (Aside: you can of course do interactive visualization when using F# Interactive from Emacs too :-)  I'm not so sure about "vi" !!)

Published Sunday, February 19, 2006 3:58 AM by dsyme

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

Sunday, February 19, 2006 8:27 PM by Numerical .NET

# Visual Studio as an interactive technical computing environment

Monday, February 20, 2006 11:12 AM by lbruck

# re: A Taste of F# Interactive in Visual Studio

This is going to be so cool :-)

Can you give a hint of what level of communication is available between the fsi window and the code windows?  If I make a change to a file that has been "#use"-d in fsi, can I have it automatically loaded once it compiles OK?
Friday, February 24, 2006 10:39 PM by Don Syme's WebLog on F# and Other Research Projects

# F# 1.1.10 now available

&amp;nbsp;
I'm glad to announce that F# 1.1.10.2 is now up on http://research.microsoft.com/downloads ...
Saturday, February 25, 2006 6:43 PM by TrackBack

# http://larkware.com/dg5/thedailygrind823.html

Tuesday, March 07, 2006 6:55 AM by NA

# re: A Taste of F# Interactive in Visual Studio

Please add FSI following features !
. one key stroke history(most important)
. GUI reference selector(I can't understand why my project's dll is rejected by FSI)
. saving functionality for saving usually using dll
Sunday, June 25, 2006 8:06 AM by sp

# re: A Taste of F# Interactive in Visual Studio

Is this functionality in the release version 1.1.10.4?

I have installed it, but cannot find mention of the tool in the documentation or the VS2005 menus.
Sunday, June 25, 2006 1:48 PM by dsyme

# re: A Taste of F# Interactive in Visual Studio

Hi sp,

Yes, this is in 1.1.10 and 1.1.11 - look for "Using F# Interactive in Visual Studio", and also look under the AddIn Manager

Don
Tuesday, July 18, 2006 4:10 PM by Dave Cooper

# F# - Combining the efficiency, scripting, strong typing and productivity of ML with the stability, libraries, cross-language working and tools of .NET.

From the F# Site at http://research.microsoft.com/fsharp/fsharp.aspx
F# is a programming language that...
Thursday, July 27, 2006 12:25 AM by Himuro

# F# Interactive doesn't work on VisualStudio2005(Japanese)

F# on VS2005 is great, but I cannot use F# interactive on VisualStudio2005 Version 8.0.50727.42(Japanese).

When I invoke F# interactive Add-in, below dialog  is showed 2 times.
--
Raised: System.ArgumentException: value is out of range
at EnvDTE.Command.set_Bindings(Object pVar)
at Microsoft.FSharp.Compiler.VSFSI.Locals.addCommand@25.Invoke(Unit _unit)
Microsoft.FSharp.Compiler.VSFSI.Locals.catchAll(FastFunc `2 f)

--
F# interactive window is correctly showed, but "Alt-Enter" doesn't work.

I hope this is bugfixed.
Thanks.
Friday, February 09, 2007 6:04 AM by Stephen

# re: A Taste of F# Interactive in Visual Studio

Oh my goodness! I just tested it and it works. F# is such a delightful treasure trove. I'm starting to notice the wrinkles in our good old C#.

Friday, April 20, 2007 4:07 PM by C?? F# « ???

# C?? F# &laquo; ???

Wednesday, May 23, 2007 4:26 PM by F# « TechnicalArchitectureWorx

# F# &laquo; TechnicalArchitectureWorx

# El laberinto de piedra &raquo; Blog Archive &raquo; .Net funcional

Saturday, June 23, 2007 10:30 AM by F# .Net » Blog Archive » F# Language

# F# .Net &raquo; Blog Archive &raquo; F# Language

# Microsoft&#8217;s Programming Language : F# &laquo; Keyur Vachhani&#8217;s Weblog

# Ghillie Suits &raquo; Don Syme&#8217;s WebLog on F# and Other Research Projects : A Taste of F# Interactive in Visual Studio

Saturday, October 27, 2007 5:05 PM by The Orbifold»Blog Archive » F#

# The Orbifold&raquo;Blog Archive &raquo; F#

# BabeStud.com &raquo; Blog Archive &raquo; Microsoft.NET Family Welcomes F# To Be As First Class .NET Language

# F# functional programming on .net framework : Life, Love and Tech

# Womens Discount Perfume &raquo; Not cool water perfume but still interesting&#8230;

# Womens Discount Perfume &raquo; Not perfume sale but still interesting&#8230;

Friday, January 11, 2008 5:22 PM by F# - Itakate

# F# - Itakate

Saturday, January 12, 2008 9:33 PM by F# - Itakate

# F# - Itakate

# Drugs and Movies &raquo; Don Syme&#8217;s WebLog on F# and Other Research Projects : A Taste of F# &#8230;

# OJ&#8217;s rants &raquo; An Interesting Little Problem

Tuesday, September 16, 2008 5:45 AM by .NET Brainwork

# Microsoft F# September 2008 CTP

Microsoft F# September 2008 CTP

Tuesday, December 23, 2008 3:33 PM by US ISV Developer Evangelism Team

# F# To Ship with Visual Studio 2010

Don Syme has announced that F# would ship as part of Visual Studio 2010 in his blog entry, F# to ship

Thursday, January 29, 2009 10:59 PM by Randy

# Is this MSDN trying to capture the EMACS editor

I think that this maybe what all the hype about EMACS.NET was about.

# Don Syme s WebLog on the F Language and Related Topics A Taste of F | Joint Pain Relief

Tuesday, June 09, 2009 5:05 AM by What &amp; Why Choose F#? | {Programming} &amp; Life

# What &amp; Why Choose F#? | {Programming} &amp; Life

# Don Syme s WebLog on the F Language and Related Topics A Taste of F | Cellulite Creams

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker