如何让 F# 与 Mono 一起工作?

发布于 2024-07-20 01:10:18 字数 29 浏览 7 评论 0原文

我似乎找不到单声道的编译器/插件。 有吗?

I can't seem to find a compiler/plugin for mono. Does one exist?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

梦里的微风 2024-07-27 01:10:18
  1. 前往此处下载 fsharp.zip
  2. 解压并打开创建的文件打开
  3. 终端并以 root 身份运行 ./install-mono.sh (在某些系统上,需要将该脚本中的换行符从 CRLF 转换为 LF)

这将为您提供基本功能,这意味着您将能够运行“mono fsi.exe”并将 F# 应用程序编译为“mono myApp.exe”。

有用的提示:

  1. 为编译器和 F# 交互创建脚本是有意义的。 即:

    /usr/local/bin/fsc

    #!/bin/sh
    执行 /usr/bin/mono /usr/local/src/FSharp-1.9.9.9/bin/fsc.exe $@

    /usr/local/bin/fsi

    #!/bin/sh
    exec /usr/bin/mono /usr/local/src/FSharp-1.9.9.9/bin/fsi.exe $@

  2. F# Interactive (fsi.exe) 默认情况下尝试引用 System.Windows.Forms,因此为了运行它,需要 Mono 中的 WinForms 支持

  3. fsi .exe 在 Xterm 中比在 Gnome 终端中工作得更好。

  1. Go here and download fsharp.zip
  2. Unzip it and open the created folder
  3. Open the terminal and run ./install-mono.sh as root (On some systems, it is necessary to convert the newline characters in that script from CRLF to LF)

This will give you the basic functionality which means you will be able to run "mono fsi.exe" and compiled F# apps as "mono myApp.exe".

Usefull tips:

  1. It makes sense to create scripts for the compiler and F# interactive. i.e.:

    /usr/local/bin/fsc

    #!/bin/sh
    exec /usr/bin/mono /usr/local/src/FSharp-1.9.9.9/bin/fsc.exe $@

    /usr/local/bin/fsi

    #!/bin/sh
    exec /usr/bin/mono /usr/local/src/FSharp-1.9.9.9/bin/fsi.exe $@

  2. F# interactive (fsi.exe) is trying to reference System.Windows.Forms by default so in order to run it WinForms support in Mono will be required

  3. fsi.exe works better in Xterm than in Gnome Terminal.

萌无敌 2024-07-27 01:10:18

作为参考,现在有 Linux(.deb 和 .rpm)软件包和 Mac OS X 安装程序,位于 http://fsxplat .codeplex.com/ 这将为您节省手动复制文件并制作自己的启动器脚本的工作。

For reference, there are now Linux (.deb and .rpm) packages and a Mac OS X installer available at http://fsxplat.codeplex.com/ which will save you the work of having to manually copy around files and make your own launcher scripts.

小镇女孩 2024-07-27 01:10:18

是的,有一个。 看看这个:F# for Mono

Yes, there's one. Check this out: F# for Mono

蝶舞 2024-07-27 01:10:18

您可以下载 来自 Microsoft 的 F# zip 文件,然后运行(例如)“mono fsi.exe”。

You can download the F# zip file from Microsoft and then run (for example) "mono fsi.exe".

人生戏 2024-07-27 01:10:18

Piotr Zurek 所说的基本上就是我为让 F# 和 mono 在 Ubuntu 9.04 上工作而所做的,并附有以下评论:

  1. 请记住使用 Mono 安装 WinForm 支持。 否则无法启动 fsi.exe。
  2. ./install-mono.sh 应使用 root 权限运行 (sudo ./install-mono.sh)。
  3. Gnome 终端不能很好地与 fsi.exe 配合使用。 启动一个普通的 xterm 并在其中运行 fsi.exe。

What Piotr Zurek said is basically what i did to get F# and mono to work on Ubuntu 9.04, with the following comments:

  1. Rember to install WinForm support with Mono. Otherwise you can't start fsi.exe.
  2. ./install-mono.sh should be run with root privileges (sudo ./install-mono.sh).
  3. Gnome Terminal dosn't play well with fsi.exe. Start a normal xterm and run fsi.exe whithin that.
(り薆情海 2024-07-27 01:10:18

到了 2019 年,许多早期的答案都已经过时了。 不需要 zip 文件或类似文件。

从 Ubuntu 19.04 开始,即 disco 您现在可以安装软件包:

sudo apt-get install mono-complete fsharp

这为您提供了位于 /usr/bin/fsharpc 的 F-sharp 编译器

或者,如果您想要最新的,您可以添加 Mono 存储库并从那里提取软件包,详细信息如下:

https://www.mono-project.com/download/stable/#download-lin

In 2019, a lot of these earlier answers are outdated. No need for zip files or the like.

From Ubuntu 19.04 onwards, i.e. disco you can now install packages with:

sudo apt-get install mono-complete fsharp

That gives you the F-sharp compiler at /usr/bin/fsharpc

Alternatively, if you want the latest, you can add the Mono repository and pull packages from there, as detailed at:

https://www.mono-project.com/download/stable/#download-lin

很酷不放纵 2024-07-27 01:10:18

另请在此处查看详细的安装说明,包括 F# PowerPack 和 MySQL 连接器: http://2sharp4u.wordpress.com/2010/09/03/installing-f-2-0-on-monolinux

Look also here for detailled installation instructions including F# PowerPack and MySQL connector: http://2sharp4u.wordpress.com/2010/09/03/installing-f-2-0-on-monolinux

日裸衫吸 2024-07-27 01:10:18

F# 编译器作者之一 Joe Pamer 在 7 月份帮助我恢复了此功能,我在这里写下了这些步骤:http://saladwithsteve.com/2010/07/building-fsharp-on-the-mac.html

Joe Pamer, one of the F# compiler authors, helped me get this working back in July, I wrote up the steps here: http://saladwithsteve.com/2010/07/building-fsharp-on-the-mac.html

没有心的人 2024-07-27 01:10:18

如果您使用的是 Ubuntu,请按照以下三个步骤操作。

  1. 此处下载并安装“.deb”包。
  2. 运行以下命令。

    sudo apt-add-repository ppa:directhex/ppa  
      sudo apt-get 更新  
      sudo apt-get install monodevelop 
      
  3. 启动 MonoDevelop。 转到加载项管理器,图库> 语言绑定> F#,安装。

If you are on Ubuntu, follow the following three steps.

  1. Download and install ".deb" package from here.
  2. Run the following commands.

    sudo apt-add-repository ppa:directhex/ppa 
    sudo apt-get update 
    sudo apt-get install monodevelop
    
  3. Start MonoDevelop. go to add-in manager, Gallery > Language bindings > F#, install.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文