tags:

views:

631

answers:

3

I am using F# on a Mac and I wonder kbow if there is any F# IDE that works over mono (not a general purpose editor). It seems that there is an addon for MonoDelvelop, but I think it may no be mature enough. Any suggestion ?

+4  A: 

I think the MonoDevelop addon will be your best bet. Unfortuately, at this point, asking for a mature F# compiler (even on Windows) is a bit of a stretch.

It's not even officially released on Windows (CTP still for VS 2008, and 2010 is still Beta).

Reed Copsey
+6  A: 

*strong text*I actually started working on a new F# binding for MonoDevelop. I'll post the news as soon as I have something worth sharing.

Strange, seems like I can't add a comment to my answer... Anyway, I'd like to start with basic functionality that allows for creating and compiling F# projects. When that's done I'll be looking at implementing things like auto-completion and thing like that.

Update: Due to a recent addition to our family I haven't been able complete my work. Fortunately someone else picked up the effort and results of his work are here: http://github.com/vasili/FSharpBinding

Piotr Zurek
This is great news! Do you plan to support auto-completion?
DannyAsher
Nice! If you need a tester here am I.
Gustavo
That's great to hear... I want to help ;)
wishi
Where are you going to post this news when there?
Johan Kullbom
+2  A: 

I use Aquamacs and some hooks into Tuareg mode. - No .Net completion (there's a C# mode here), but dabrev mode:

;; F# specific configs 
;; hooked ocaml tuareg mode. If you do ML with mono e. g. 
(add-to-list 'load-path "~/.elisp/tuareg-mode")
    (autoload 'tuareg-mode "tuareg" "Major mode for editing Caml code" t)
    (autoload 'camldebug "camldebug" "Run the Caml debugger" t)
    (autoload 'tuareg-imenu-set-imenu "tuareg-imenu" 
      "Configuration of imenu for tuareg" t) 
    (add-hook 'tuareg-mode-hook 'tuareg-imenu-set-imenu)
    (setq auto-mode-alist 
        (append '(("\\.ml[ily]?$" . tuareg-mode)
              ("\\.topml$" . tuareg-mode))
                  auto-mode-alist))

;; now we use *.fs files for this mode
(setq auto-mode-alist (cons '("\\.fs\\w?" . tuareg-mode) auto-mode-alist))

(add-hook 'tuareg-mode-hook
       '(lambda ()
       (set (make-local-variable 'compile-command)
        (concat "fsc \""
            (file-name-nondirectory buffer-file-name)
            "\""))))

(defun tuareg-find-alternate-file ()
  "Switch Implementation/Interface."
  (interactive)
  (let ((name (buffer-file-name)))
    (if (string-match "\\`\\(.*\\)\\.fs\\(i\\)?\\'" name)
    (find-file (concat (tuareg-match-string 1 name)
               (if (match-beginning 2) ".fs" ".fsi"))))))
  • compile from the editor window with FSC
  • get an interactive session with syntax highlighting with the Mono backend alt text

You get syntax highlighting from Ocaml (very similar) and it takes care for the white spaces. I had some problems forking the FSI from Shell, because it seems there's a delay while typing. I didn't investigate this issue and switched to VisualStudio.

Alternatively there's a Textmate F# bundle. I did test that for half a minute and it works. However you don't get the Alt+Enter option from VS to evaluate your marked parts directly at the interactive prompt.

wishi
The Textmate bundle actually do give you a simple Alt+Enter option against a running fsi-session in iTerm.
Johan Kullbom