嵌入 C# 桌面应用程序的最佳脚本语言是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/137933/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the best scripting language to embed in a C# desktop application?
提问by Ewan Makepeace
We are writing a complex rich desktop application and need to offer flexibility in reporting formats so we thought we would just expose our object model to a scripting langauge. Time was when that meant VBA (which is still an option), but the managed code derivative VSTA (I think) seems to have withered on the vine.
我们正在编写一个复杂的富桌面应用程序,需要在报告格式方面提供灵活性,因此我们认为我们只需将我们的对象模型暴露给脚本语言即可。时间是这意味着 VBA(这仍然是一个选项),但托管代码衍生 VSTA(我认为)似乎已经枯萎了。
What is now the best choice for an embedded scripting language on Windows .NET?
现在,Windows .NET 上的嵌入式脚本语言的最佳选择是什么?
采纳答案by Hector Sosa Jr
I've used CSScriptwith amazing results. It really cut down on having to do bindings and other low level stuff in my scriptable apps.
我使用CSScript 取得了惊人的效果。它确实减少了必须在我的可编写脚本的应用程序中进行绑定和其他低级工作的情况。
回答by Ben Hoffstein
IronPython. Here's an overview of how to embed it.
回答by Rodrick Chapman
The PowerShell engine was designed to be easily embedded in an application to make it scriptable. In fact, the PowerShell CLI is just a text based interface to the engine.
PowerShell 引擎旨在轻松嵌入到应用程序中,使其可编写脚本。事实上,PowerShell CLI 只是一个基于文本的引擎界面。
Edit: See https://devblogs.microsoft.com/powershell/making-applications-scriptable-via-powershell/
编辑:见https://devblogs.microsoft.com/powershell/making-applications-scriptable-via-powershell/
回答by Borek Bernard
IronRuby as mentioned above. An interesting project to me as a C# programmer is C# Eval support in Mono. But it's not available yet (will be part of Mono 2.2).
IronRuby 如上所述。作为一名 C# 程序员,对我来说一个有趣的项目是Mono 中的 C# Eval 支持。但它尚不可用(将成为 Mono 2.2 的一部分)。
回答by mattlant
I havnt tried this yet but it looks pretty cool:
我还没有尝试过,但它看起来很酷:
回答by mattlant
I've just created a plugin for a client, allowing them to write C# code in modules that act like VBA does for Office.
我刚刚为客户端创建了一个插件,允许他们在模块中编写 C# 代码,就像 VBA 为 Office 所做的那样。
回答by Remo.D
My scripting language of choice would be Luathese days. It's small, fast, clean, fully documented, well supported, has a great community, it's used by many big companies in the industry(Adobe, Blizzard, EA Games), definetely worth a try.
这些天我选择的脚本语言是Lua。它体积小、速度快、干净、文档齐全、支持良好、拥有强大的社区,被业内许多大公司(Adobe、暴雪、EA 游戏)使用,绝对值得一试。
To use it with .NET languages the LuaInterfaceproject will provide all you need.
要将它与 .NET 语言一起使用,LuaInterface项目将提供您所需要的一切。
回答by DAC
Why not try C#? Mono has a great new project especially for dynamically evaluating C# :
为什么不试试 C#?Mono 有一个很棒的新项目,特别是用于动态评估 C# :
回答by Robert Rossney
Another vote for IronPython. Embedding it is simple, interoperation with .Net classes is straightforward, and, well, it's Python.
IronPython 的另一票。嵌入它很简单,与 .Net 类的互操作很简单,而且,它是 Python。