core icon indicating copy to clipboard operation
core copied to clipboard

CSharp Loader F# Support: hello sample

Open avestura opened this issue 6 years ago • 2 comments

Added F# hello sample from C# sample

avestura avatar Mar 20 '19 15:03 avestura

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.

viferga avatar Mar 20 '19 17:03 viferga

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.

avestura avatar Mar 20 '19 17:03 avestura