简体   繁体   中英

How to run F# interactive (fsi.exe) in dotnet core? Is it supported yet?

I cannot run find/run fsi.exe either in windows or linux on dotnetcore. It is nowhere to be found. Maybe it is not supported yet?

F# for CoreCLR Status says that FSI on CoreCLR is complete, so presumably it would work if one could find it.

In another ticket — Why were the C# and F# REPLs removed and when/how will it implemented "as a separate tool"? — it's claimed that dotnet repl fsi used to work but was removed in favour of an (as yet non-existent) separate package.

Please correct me if I'm wrong but, today (Dec '19)
f# interactive with netcore is working in Ubuntu 18.04
With the standard installation instructions from
https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-manager-ubuntu-1904
and 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"]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM