I think the idea in point one is very interesting but I think being able to output code from FSI is not quite the right solution. I have been using F# with visual studio and the interactive plug in for quite a while now. It great being able to type a line of code then using a keystroke have it executed in the interactive window, plus because the code is already in a text file it by default stored for later use. It is also a hell of a lot easier to go back and change a line if you realise you have made a mistake which is frankly a nightmare when just working with FSI on its own.

However it is not perfect and there are quite a few little features I’d like to change about it, for instance copy and pasting from F# interactive isn’t great, it would be nice to have a key stroke to hop into the F# interactive box, and the F# visual studio integration isn’t that great at managing text files.

It has therefore occurred to me that it might be a good idea to create my own F# IDE, with a real focus on being able to mange text files in “project explorer” style window, having good support for interactively running different parts of your program in the main window and another window for the results of the program.

I don’t think all this would be too hard to archive and it could even be written in F# itself. I think there are some great ideas that could be stolen from John Lam’s RubyCLR IDE [link:port25.technet.com], which I haven’t tried but looks great.

However, there are a couple of things that put me off I think this would be quite time consuming to produce something polished enough to better than the visual studio IDE and also Don Syme has indicated that the visual studio integration will probably be improved to follow some the ideas I suggested.

By on 8/27/2006 7:57 AM ()

It [is] great being able to type a line of code then using a keystroke have it executed in the interactive window, plus because the code is already in a text file it by default stored for later use. It is also a hell of a lot easier to go back and change a line if you realise you have made a mistake which is frankly a nightmare when just working with FSI on its own.

[ ... ]

However, there are a couple of things that put me off I think this would be quite time consuming to produce something polished enough to better than the visual studio IDE and also Don Syme has indicated that the visual studio integration will probably be improved to follow some the ideas I suggested.

I am in the awkward position of insisting on using the Visual Studio Express Editions in my work and in anything I produce that I'd like to make available to beginners and enthusiasts. It is great to have IronPython and F# as additions to the armaments for doing that. It is awful, as Robert notes, to use FSI from the console in conjunction with some editor (e.g., notepad) holding the code I am working on. (click save, exit from FSI if I haven't already, launch it with my file again, look at the result, go back to the editor, rinse repeat ...).

I thought the VSCmdShell Power Toy would be helpful, but it requires VS extensibility provisions not found in VS Express Editions as well.

I haven't given up on getting an Express Edition to help here (with some Project/Item template cleverness and maybe even faking a make project). If that avenue fails, I'll use something like jEdit that does have plug-ins that may work (and even provide modest source-code-control integration). This is not exactly beginner-enthusiast level, but it is at least all free (along with the JDK that is needed), and I need to install the JDK for other reasons. Just the same, I would prefer something that works in VS Express Editions because of their quality, ease of installation, and the attraction to newcomers that want to develop on and for Windows.

By on 9/23/2006 3:12 PM ()

[ A quick note (I'm on holidays for a week...) ]

Hi Martin,

This is an interesting and thoughtful post (os - a blog for martin?). A couple of quick notes now and more when I return from holidays.

re 2 - F# currently takes the philosophy that module signatures are the mechanism by which values, members and other functionality associated with modules and types are abstracted (hidden). This is also the OCaml philosophy. However the F# design team (primarily James and myself) have agreed in principle to support more direct ways of specifying visibility.

re 3 - ((a.d).e()).f can be written (a.d.e()).f. However you are correct that the application e() does not bind tightly enough (the subsequent "." binds more tightly). We have not yet decided what to do about this but are in the process of doing so - but your solution is one option.

re 4 - ocaml-style variants feel tempting here, or some variation of them (no pun intended).

don

By on 8/26/2006 8:48 AM ()

Re 2 Don - I had momentarily forgotten about the use of .fsi files to obscure visibility (I'd previously only used them for documentation and forgotten their more functional use) - this is of course a good option, and it also shows why compiling val fields to internal fields rather than protected ones as I mentioned above is wise.

A blog for me would be quite good, although I'm not sure how often I would update it! Whenever something comes up I guess. Also soon I shall put aforementioned RayTracer up.

By on 8/28/2006 12:11 PM ()

Hi Martin,

You wrote:

3. Some left-associative . operator
In C#, I would often find myself writing a.d.e().f accessing a property of the result of a method of a property of object a. To write this in F#, one needs to write ((a.d).e()).f and if there is a long chain of these (as I have sometimes found in C#) this can become cumbersome. It would be useful to have a syntactic sugar left-associative . operator such as :, so that ((a.d).e()).f can be written a:d:e():f. Unforunately this clearly cannot be written as a higher-order function and so needs to be a language feature. Changing the associativity of . could also be a solution, but perhaps a more dramatic one.

Just to let you know that F# 1.1.12.5 is now available and that we have now addressed this issue. From the release notes:

High Precedence Application. A long-standing problem with the F# syntax is that method applications followed by property/field lookups such as obj.Method1(args).Method2(args).Property1.field2 have had to be written with very non-intuitive parentheses, e.g. ((obj.Method1(args)).Method2(args)).Property1.field2.

To fix this, this release incorporates a minor change in the F# syntax (with and without the #light syntax option). In particular, applications id(args) now have higher precedence (i.e. bind more tightly) than the dot-notation. This only applies when no spaces or other whitespace separate the identifier and the arguments.

By on 9/22/2006 8:16 PM ()

applications id(args) now have higher precedence (i.e. bind more tightly) than the dot-notation. This only applies when no spaces or other whitespace separate the identifier and the arguments.

Great! I was about to comment on approaches to this but I was smart enough to read the rest of the thread first. (By the way, I like the tree-view of the thread that is an available option here.)

For precedent, there is A Programming Language in its early application as a reference language by Ken Iverson and Fred Brooks. The analogy is as follows (where here, evaluation/application is associated right to left):

1
   f[ i ] a(x,y) q

are such that the bracketted operands (either [ ... ] or ( ... ) or any other bracketted forms) are bound to the operation on the left, if there is one, so that the above example ends up having the same applicative structure as

1
  (f[ i ])((a(x,y))(q))

I haven't asked how they arrived at this, although I think the move from typographical subscripts to A[i,j] forms was influential, along with the implicit right-to-left evaluation where, absent any bracketted operands,

1
  f a b c

has the same applicative structure as f(a(b(c))).

I think it is great that something like that principle is workable for "."-chains in F#.

By on 9/23/2006 2:59 PM ()

Sounds good. Are these release notes available online anywhere? I can't seem to find them without downloading/installing the package, and was wondering what the other changes were and to whether it was worth downloading this one or waiting until the next more major release.

Also, I have been working on F# coroutines, details of which can be found in another thread in this forum ("Implementation of coroutines in F#")

By on 9/23/2006 4:59 AM ()

I've posted the full release notes for F# 1.1.12.5 here.

By on 9/23/2006 6:05 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