投资菜地

屋后的一亩三分绿色菜园地

2017-04-19

动态脚本引擎

动态脚本Script

一个轻量级的动态脚本引擎,结合的Python和JavaScript语法。

Documentation

Please view the wiki for a comprehensive overview and code samples.

Features

  • Written from the ground up for readability.
  • Intuitive C# syntax on intepreter and script side.
  • Comprehensive syntax errors and script errors.
  • Strict typing allows method overloading based on datatype.
  • Simple… int, double, string, bool, and regex data types.
  • Implicit conversions for all types ("foo1" = "foo" + 1)

Hello World

static void Main()
{
    var engine = new ScriptEngine();
    engine.AddAction<string>("log", Log);
    engine.Execute("log('Hello World!')");
    Console.In.Read();
}
static void Log(string message)
{
    Console.WriteLine(message);
}

开源项目(更多)