Are there any F# alternative (non-.Net) implementation projects? - f#

Some popular languages like Python and Ruby have native, JVM and .Net CLR implementations. C# is implemented with free Mono project. Aren't there any attempts of implementing F#?

As others pointed out, the standard F# implementation from Microsoft is just a .NET (CLI) application that runs on multiple implementations of CLI (namely .NET and Mono). F# also produces .NET (CLI) applications as libraries that also work on both .NET and Mono. However, that is still the same CLI implementation of F# (just running on different implementation of CLI)
To answer your question -
As far as I know, there is no other attempt to implement F# compiler for other platforms/runtimes.
F# shares a common background with OCaml, so the easiest way to get another implementation of F# would be to take OCaml and add F#-specific features (and remove OCaml-specific features).
You can use only shared sub-language and cross-compile using both F# and OCaml.
Also, there are some plans to release F# as open source, so it may be possible that (in the future), someone will port F# to other platforms such as JVM using the source (when released).

F# interactive, fsi.exe, already runs on Mono, as do compiled F# programs.

There is a compiler for targeting a subset of F# to FPGAs, which I guess is a non-.NET implementation
http://www.avalda.com/
Link

Mono is an implementation of .net which happens to include a c# compiler (as well as a vb compiler). It is not primarily a c# implementation.

Related

fable websharper borelo SAFE which should I use?

I'm trying to use F# to develop a chrome extension and found that there are some framework : fable, websharper, borelo and SAFE in https://fsharp.org/use/web-apps/
I don't know how to choose . Can Anyone help me to make the choice?
For a Chrome extensions in particular I would probably recommend Fable.
Fable is an F# to JavaScript compiler and should be compatible with what Chrome expects for extension development. If you want/need to use existing JS packages e.g. from npm this is probably the way to go.
Bolero uses WebAssembly to run .Net in the browser which seems likely to introduce more compatibility issues. Though there are examples using WebAssembly. It would also, in principle, give you access to many .Net libraries to integrate with your extension.
I've not used WebSharper. My understanding is it also provides F# to JS compilation so it may be suitable.
SAFE isn't a separate technology. It is essentially a template which combines F# + Fable in the browser and F# + .Net on the server for writing full stack apps in 100% F#.

Redistributable version of FSharp.Core.dll?

I have developed a commercial extension for the Unity3D game engine in F#, it's a piece of code which extends the editor with advanced node/graph editing features. F# is perfect for this due to the nature of immutability and DU's.
But, to my question: I realized that the license for the FSharp.Core.dll which comes with Microsoft .NET/Visual Studio probably doesn't allow you to re-distribute it with a commercial project? How would I go about finding out if this is the case or not, and if it's not is there any way to create my own compiled version of FSharp.Core.dll which would run on Unity3D?
The reason I ask is because Unity3D uses Mono 2.6 (albeit a modified version, to my understanding) under the hood, and there is no FSharp.Core.dll bundled with the editor, so I need to supply my own with my extension.
See: Is F# 3.0 runtime redistributable?
The answer is of course Yes. The language would be pretty useless if its core library wasn't re-distributable...

Is F# in general and the F# plugin for MonoDevelop maintained for Linux?

I would like to play around with F# on my Linux box, but I struggle to find up-to-date versions of the relevant files. The F# cross-platform packages are from 2010 and the plug-in seems to be for Monodevelop 2.4 (I have 2.8 installed, which is not the newest anyway...). Is the project still alive? Am I looking at the right place?
F# cross-platform package is pretty outdated. Depending on which Linux distro you're using, F# may be distributed with Mono 2.10.x (check Mono homepage for details). Otherwise, you should build F# compiler from source for latest version.
The original F# binding does not work with MonoDevelop 2.8. Fortunately, the F# binding is being actively developed by Scott Stephens under a Google Summer of Code project. There are first positive sights as being mentioned here. For discussion, you can post on F# Open Source Community Group or ask questions here.
The F# addin for Monodevelop is still developed as of 2014 and is available from addins.monodevelop.com.

Metro style Apps with F#?

In the Build 2011 keynote and demos, they were always talking about C++, C#, Visual Basic and JavaScript. Can't I build Metro style Apps with F#? Or is it safe to say that if it works with C#, then it works with F# as well?
Or is it eligible to say if it works with C# then it works with F# as well?
Yes, that's how it is supposed to work. In addition to javascript and C/C++, any CLS compliant language that runs on top of the CLR will have access to the WinRT API.
Unfortunately in the VS 2011 Express edition you don't get tooling support but I guess this will be added progressively or to other editions:
Don talks about this a little around 7:40 into his talk.
http://channel9.msdn.com/Events/BUILD/BUILD2011/SAC-904T
I had the same question and created a blog post: Create a Metro App in F# (NOT)
There are a few issues:
You cannot reference ordinary .NET dll’s (even in C#). They have to
be have recompiled with a “reference” to the WinRT. Because of this
you cannot reference the F# dll. I think this will be solved when F#
3.0 get released (source: Understanding F# slide from Don Syme at
build).
The ability from F# to create Metro apps. This has to be
built by the F# team. This is an open question. This is the all-F#
approach (In WPF it is today possible but not recommended).
Tool support for creation Metro front-end projects. This will be not the case for the
F# 3.0 release. (source: Understanding F# slide from Don Syme at
build).
Using Visual Studio 11 Developer Preview (Full, not Express), I was able to reference and run F# code from a C# Metro style application with the following caveats:
You will get a build warning saying that the project can't be referenced, even though Visual Studio will still allow you to add it.
You must remove all references to all DLL's in the F# project, including FSharp.Core.
By following these steps it is possible to run F# code from a C# Metro style application, but it is nearly impossible to write any useful code in F# without references to the core language libraries. Let's hope they update the libraries to be WinRT compatible soon.
The question has been answered here:
Windows 8 and F#
Although you cannot create and design Metro apps directly in F#, you can still create so called Portable library in F# with all Models and ViewModels and use it in another Metro projects. It's not ideal, but it works.
I ported my stock chart library for .NET3.5-4.0 to Portable library,it works quite well on Metro with C# Metro application and some my Metro UI bridge.
I'm convinced that I can use F# to make Metro application in many parts.

F# on/in SharpDevelop?

Is there an F# compiler (plugin?) for SharpDevelop? I use SharpDevelop on my netbook for hobby development and it would be cool to program in f# on it.
If you install the F# compiler, SharpDevelop 3.0 automatically supports it. (Oh well. At least people will get a good answer now.)
On Windows, I settled on Visual Studio Shell and the May F# CTP.
There's a rather old (Aug 2008) F# Plugin for MonoDevelop. Read more on its Wiki page.
For the F# compiler, download the xip file from the F# May 2009 CTP page. there are certain known issues with running it on Mono, just search for "F# Mono" for more info.
Now Visual Studio 2010 supports F#. However, that doesn't include the Express editions, so if you're looking for F# IDEs for free, then there's a MonoDevelop plugin (which needs v2.6 IIRC), you can install Visual Studio Shell Integrated and add FSharp to that, or SharpDevelop.
Of these, I'd probably recommend the Visual Studio Shell over the others as it seems to have the best integration between the editor window and the F# Console window. However, if you're interested in doing things cross-platform, then look at MonoDevelop, as you can make sure that something will work on Mono.

Resources