core
core copied to clipboard
CSharp Loader F# Support: hello sample
Added F# hello sample from C# sample
It seems not to work when trying to load it as a script. It has been tested with metacallcli:
CS0116: A namespace cannot directly contain members such as fields or methods CS1514: { expected CS1022: Type or namespace definition, or end-of-file expected CS1002: ; expected CS1022: Type or namespace definition, or end-of-file expected CS0116: A namespace cannot directly contain members such as fields or methods CS1022: Type or namespace definition, or end-of-file expected CS1002: ; expected CS1520: Method must have a return type CS1002: ; expected CS1022: Type or namespace definition, or end-of-file expected CS1514: { expected CS1513: } expected CS1002: ; expected ...
This is happening because of this method only supports CSharp. An addition would be to use F# compiler services to implement full support to F#. Visual Basic can be easily done too, with less work (only file extension detection and switch between SyntaxTree depending on it).
Compiled DLL not tested, but I think it should work because of uniformity of netcore assemblies.
That's all true. Roslyn is the compiler platform for only C# and VB, thus it can't analyze F# source codes. This is a sample for testing F# support, using the C# loader for .NET Assemblies. I'll add the project file for easier compilation.