Is it possible to run .fsx files using .net core? (Equivalent to fsharpi
on Mono.)
It works out of the box in .NETCore v3.0 or newer:
$ cat hello.fsx
#!/usr/bin/env fsharpi
printfn "hello world"
$ dotnet fsi hello.fsx
hello world
$ dotnet --version
3.0.100
PS: Side-note: if you want to compile your scripts without having to run them, check this tool (only Linux/Mac compatible for now sorry, we accept PRs to add Windows support).
I went looking for this answer and the best I could find matches your comment @Martimatix from March 28 however I did find issue 2407 in the visualfsharp repo which tracks the support for fsi on .NET Core 2.0.
Update (April 2009): It looks like there is now a preview version now for .NET Core available. https://devblogs.microsoft.com/dotnet/announcing-net-core-3-preview-3/
They are working on it. This is the main issue, the same one posted by jpierson.
You can try right now with something like this:
dotnet /usr/share/dotnet/sdk/2.1.403/FSharp/fsi.exe test.fsx
It kinda / sorta works, but there are parts missing, especially full support for #r
and interactive line editing (readline).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With