.netlinuxf#.net-coref#-interactive

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?


Solution

  • 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://learn.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"]