如何在dotnet核心中运行F#interactive(fsi.exe)?它支持吗?

时间:2016-09-05 10:11:43

标签: .net linux f# .net-core f#-interactive

我无法在windows或linux上的dotnetcore上运行find / run fsi.exe。它无处可寻。也许它还不支持?

2 个答案:

答案 0 :(得分:7)

F# for CoreCLR Status说CoreCLR上的FSI是完整的,所以如果有人能找到它,它可能会起作用。

在另一张机票 - Why were the C# and F# REPLs removed and when/how will it implemented "as a separate tool"?中 - 它声称dotnet repl fsi曾经工作但被删除而支持(原来不存在的)独立包裹。

答案 1 :(得分:2)

如果我错了,请纠正我,但今天(19年12月)
与netcore交互的f#在Ubuntu 18.04中工作
使用来自
的标准安装说明 https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-manager-ubuntu-1904
https://fsharp.org/use/linux/

// file: runtime.fsx
open System
open System.Reflection
open System.Runtime
open System.Linq

Type.GetType("Mono.Runtime")
|> printf "Mono.Runtime: %A\n"
(Assembly.GetEntryAssembly().GetCustomAttributesData()
         .FirstOrDefault((fun a -> 
            a.AttributeType = typedefof<Versioning.TargetFrameworkAttribute>)))
         .ConstructorArguments
|> printf "Framework: %A\n"
$ fsi runtime.fsx 
Mono.Runtime: Mono.Runtime
Framework: seq [".NETFramework,Version=v4.6"]

...

$ dotnet fsi runtime.fsx 
Mono.Runtime: <null>
Framework: seq [".NETCoreApp,Version=v2.1"]