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

Vla*_*ekk 23 .net linux f# f#-interactive .net-core

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

小智 7

CoreCLR Status的F#表示CoreCLR上的FSI已经完成,所以如果有人能找到它,它可能会起作用.

在另一张票中 - 为什么删除了C#和F#REPL以及何时/如何实现"作为单独的工具"?- 它声称dotnet repl fsi曾经工作但被删除了有利于(现在不存在)单独的包.


Dan*_*Dan 3

如果我错了,请纠正我,但是,今天(2019 年 12 月)
f# 与 netcore 的交互可以在 Ubuntu 18.04 中使用https://learn.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"
Run Code Online (Sandbox Code Playgroud)
$ fsi runtime.fsx 
Mono.Runtime: Mono.Runtime
Framework: seq [".NETFramework,Version=v4.6"]
Run Code Online (Sandbox Code Playgroud)

...

$ dotnet fsi runtime.fsx 
Mono.Runtime: <null>
Framework: seq [".NETCoreApp,Version=v2.1"]
Run Code Online (Sandbox Code Playgroud)