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.
-
1programmers.stackexchange.com/a/267654/31260gnat– gnat2015年05月06日 15:33:02 +00:00Commented May 6, 2015 at 15:33
1 Answer 1
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.
-
Notice that older versions of GCC had an old
gcj
compiler able to compile an old Java standard program to some native executable.Basile Starynkevitch– Basile Starynkevitch2015年05月06日 15:49:26 +00:00Commented May 6, 2015 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– David Raab2015年09月18日 16:43:51 +00:00Commented Sep 18, 2015 at 16:43