在大型应用程序中托管.fsx脚本 [英] Hosting .fsx scripts inside larger applications

查看:70
本文介绍了在大型应用程序中托管.fsx脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的F#库公开为可编写脚本的数据处理工具.

I want to expose my F# libraries as a scriptable tool for data manipulation.

理想情况下,我希望此脚本编制工具不需要使用fsi等进行完整的F#安装.

Optimally, I want this scripting facility to not require a full F# install with fsi and so on.

有没有一种方法可以链接到FSI库中以执行F#代码中的脚本?我的google-fu在这方面失败了,fsi的F#源有点纠结.

Is there a way to link into the FSI libraries to execute scripts from F# code? My google-fu is failing me on this one, and the F# sources for fsi are a bit tangled.

推荐答案

否,没有用于F#交互式会话的托管API. fsi.exe本身被分解为处理交互的轻量级客户端进程,以及完成繁重工作的后台服务器进程. (服务器进程是建立在F#编译器DLL之上的,这就是为什么您需要完整安装F#的原因,而不仅仅是F#运行时重做器.顺便说一句,为此公开一个API是一个有点普遍的要求,也是F#团队会考虑的事情以便将来发布.)

No, there's no hosting API for F# interactive sessions. fsi.exe itself is factored into a lightweight client process that handles the interaction, and a background server process that does the heavy lifting. (The server process is built atop the F# compiler DLLs, which is why you need a full install of F#, and not just the F# runtime redist. BTW, exposing an API for this is a somewhat common request and something the F# team will consider for a future release.)

也就是说,如果客户端确实安装了完整的F#,则您始终可以只发布客​​户端可以#load的某些脚本(.fsx文件)或客户端可以#r来启动的库(.dll文件).关闭他们的交互式fsi会话.这绝对是使用F#交互式进行数据操作和探索的好模式.

That said, if clients do have a full install of F#, then you can always just ship some scripts (.fsx files) clients can #load, or libraries (.dll files) that clients can #r to start off their interactive fsi sessions. This is definitely a good mode for using F# interactive for data manipulation and exploration.

这篇关于在大型应用程序中托管.fsx脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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