C#/.NET scripting library

送分小仙女□ 提交于 2019-12-17 18:29:57

问题


I want to enhance an application with scripting support like many other applications have, e.g. MS Office using VBA or UltraEdit using JavaScript.

Which libraries do exist for C#/.NET (and which language(s) do they support)?


回答1:


IronPython is a dynamic .NET scripting language.

IronPython is an implementation of the Python programming language running under .NET and Silverlight. It supports an interactive console with fully dynamic compilation. It's well integrated with the rest of the .NET Framework and makes all .NET libraries easily available to Python programmers, while maintaining compatibility with the Python language.

See IronPython embedding for examples showing ways to call IronPython from .NET apps. The IronPython Calculator and the Evaluator goes into the details of using IronPython from a C# application.




回答2:


Please check CS Scripting library

Here is an article about scripting Photoshop CS with C#

This one discusses using LUA as scripting lib with C#.




回答3:


Lua is often touted as being one of the better ones... Try looking at this other question for more information: What are the most effective ways to use Lua with C#?

Also:

  • Lua Interface
  • Binding code to Lua



回答4:


See "What is the best scripting language to embed in a C# desktop application."

Also see "It Already Is A Scripting Language" from Eric Lippert.




回答5:


Don't forget LSharp, LISP in .NET. Something to keep an eye on if you are exploring functionality stage. Maybe Rob Blackwell will be glad to hear you're considering it.




回答6:


You can bake your own scripting environment with Mono.CSharp (just one simple dll) or Roslyn, both are getting quite mature now.

Mono contains the Evaluator class and Roslyn the ScriptEngine, both make it a breeze setting up a script environment. Of course something like ScriptCS already builds on that (Roslyn) and gives you more features.

For an C# script environment built on Mono.CSharp you can check out CShell (which I made).




回答7:


Depending on your needs, the SILK library might be a good option.

It's an easy to use interpreter. The interpreted language is not C#. It's a custom language that was designed to be easy to use (very little punctuation, not case sensitive, etc.) But it does support functions.

Built-in functions are handled via events. That is, when the interpreted code calls one of your internal functions, it raises an event in your program.



来源:https://stackoverflow.com/questions/1067784/c-net-scripting-library

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!