0

Does F# like C# requires .NET framework to run? According to Wikipedia as stated below, F# is mostly used as a CLI language which means that it is used mostly with .NET. But it also states that the F# foundation provides a compiler for F# separately.

F# is most often used as a cross-platform CLI language, but can also be used to generate JavaScript and GPU code.

F# is developed by the F# Software Foundation,[6] Microsoft and open contributors. An open source, cross-platform compiler for F# is available from the F# Software Foundation. F# is also a fully supported language in Visual Studio and Xamarin Studio. Other tools supporting F# development include Mono, MonoDevelop, SharpDevelop and WebSharper.

Does it mean that F# can be used like unmanaged code similar to C++ and C. I am a total newbie to the .NET platform.

1 Answers1

4

Does it mean that F# can be used like unmanaged code similar to C++ and C?

Theoretically, yes. Practically, no.

Languages often don't specify how they're compiled. There's nothing precluding you from taking the syntax and semantics of Java or C# and have them compile down directly to x86 assembly and avoid the need for the JVM or .NET runtime.

That said, such a compiler doesn't exist (as far as I know) - so if you want that functionality you'll need to spend a few years to decades building it yourself. And I would question any reason for thinking you'd want that in the first place.

sourcenouveau
  • 6,460
  • 4
  • 29
  • 44
Telastyn
  • 108,850
  • 29
  • 239
  • 365
  • Notice that older versions of [GCC](http://gcc.gnu.org/) had an old `gcj` compiler able to compile an old Java standard program to some native executable. – Basile Starynkevitch May 06 '15 at 15:49
  • A question is what `used like unmanaged code similiar to C++ and C` even means. Someone can just statically link and embed the runtime into an executable. So it is still a managed language with a runtime, but contains everything and didn't need a separated installed VM. – David Raab Sep 18 '15 at 16:43