你会推荐铁红宝石,铁Python或PowerShell中制作一个C#应用程序的脚本主机? [英] Would you recommend Iron Ruby, Iron Python, or PowerShell for making a C# application a script host?

查看:144
本文介绍了你会推荐铁红宝石,铁Python或PowerShell中制作一个C#应用程序的脚本主机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你会推荐铁红宝石,铁Python或PowerShell中制作一个C#应用程序脚本宿主?

Would you recommend Iron Ruby, Iron Python, or PowerShell for making a C# application a script host?

一些快速修补后,现在我倾向于PowerShell的原因主要有两个(注意这纯属我的意见,如果他们错了,我很想知道!):

After some quick tinkering, right now I'm leaning towards powershell for two main reasons (note these a purely my opinions and if they are wrong, I'd love to know!!!):

1)这是简单的创建在你的应用程序类一个运行空间;为此它很容易使您的应用程序编写脚本。

1) It's simple to create a runspace with classes in your application; therefor it's easy to make your application scriptable.

2)我已经听到了一些传言说的IronRuby和IronPython从微软失去支持,所以他们可能是一个糟糕的长期解决方案?

2) I've heard some rumors that IronRuby and IronPython are losing support from Microsoft, so they may be a poor long term solution?

由于这是我第一次添加脚本到一个应用程序,虽然,我欢迎所有的意见,我可以从谁一直沿着这条道路之前,人们得到。

As this is my first time adding scripting to an application though, I'd welcome all the advice I can get from people who have been down this road before.

具体而言,除了让我知道你是否与我的以上两点同意,我想知道的IronRuby和IronPython更容易使用(为用户,开发者不),比PowerShell的,如果在使用DLR你的经历是那么容易,因为只是路过一个目标是一个PowerShell运行空间?如果我增加了对DLR和IR / IP的脚本支持将我的应用程序仍与XP向后兼容?

Specifically, besides letting me know whether you agree with my two points above, I'd like to know if IronRuby and IronPython are much easier to use (for a user, not developer) than powershell, and if in your experience using the DLR is as easy as just passing an object to a powershell runspace? And if I added support for the DLR and IR/IP scripting would my application still be backwards compatible with XP?

推荐答案

我米不服气PowerShell有是应用程序的脚本语言的任何地方,在它的长期目标。它的第一外壳,第二集成功放&;自动化引擎和第三外壳脚本语言......因为它不是在所有的再发行,我不知道在哪里嵌入式脚本的用武之地。

I'm not convinced PowerShell has "being a scripting language for applications" anywhere in it's long-term goals. It's first a shell, second an integration & automation engine, and third a shell scripting language ... since it's not redistributable at all, I'm not sure where embedded scripting fits in.

这当然很容易主持人PowerShell的 - 假设这是你的目标PCs--所以这是一个非常可行的选择预装的,但我认为,一般来说,它只是作为易于使用的IronRuby或IronPython的做到这一点。

It's certainly very easy to host PowerShell -- assuming that it's pre-installed on your target PCs-- so it's a very viable option, but I think that in general it's just as easy to do it with IronRuby or IronPython.

我怀疑DLR本身会消失,所以我认为使用DLR语言仍然是一个很好的选择:你会被设置为接受其他DLR语言少得多的努力,以及和DLR语言是可再发行组件

I doubt the DLR itself is going away, so I think using a DLR language is still a good choice for this: you'd be set up to accept other DLR languages with much less effort, and the DLR and languages are redistributable.

此外,工作举办PowerShell中只得到你PowerShell的 - 而你可以利用同样的工作得到IronPython和IronRuby的工作。谁知道,因为PowerShell是一个动态语言,说不定就会被移植到在未来的版本中加入合适的动态支持DLR ...但它不可能永远是可再发行,因为微软不认为这是一个开发工具,而是该OS的核心部分。

Also, the work to host PowerShell only gets you PowerShell -- whereas you can leverage the same work to get IronPython and IronRuby working. Who knows, since PowerShell is a dynamic language, maybe it will be ported to the DLR with proper dynamics support in a future version ... but it's unlikely to ever be redistributable, because Microsoft doesn't consider it a dev tool, but rather a core part of the OS.

底线:使用DLR是更便携的 - 而不仅仅是XP,但连单(因此到Linux,OS X,iOS版,Android版,等等,甚至通过Silverlight的网页或Windows Phone)。

Bottom line: using the DLR is much more portable -- and not just to XP but even to Mono (and thus to Linux, OS X, iOS, Android, etc... and even to the web or Windows Phone via Silverlight).

这篇关于你会推荐铁红宝石,铁Python或PowerShell中制作一个C#应用程序的脚本主机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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