您可以使用 .net core 运行 F# 脚本文件 (.fsx) 吗? [英] Can you run an F# script file (.fsx) using .net core?

查看:28
本文介绍了您可以使用 .net core 运行 F# 脚本文件 (.fsx) 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用 .net core 运行 .fsx 文件?(相当于 Mono 上的 fsharpi.)

Is it possible to run .fsx files using .net core? (Equivalent to fsharpi on Mono.)

推荐答案

它在 .NETCore v3.0 或更新版本中开箱即用:

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:旁注:如果你想编译你的脚本而不必运行它们,请检查这个工具(目前只兼容 Linux/Mac 抱歉,我们接受 PR 以添加 Windows 支持).

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).

这篇关于您可以使用 .net core 运行 F# 脚本文件 (.fsx) 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆