Lua 的 .NET 实现:NeoLua
2016-07-19 19:02
585 查看
NeoLua是Lua 语言的一个.Net实现。可以在 .NET 的应用中调用 Lua 语言或者反过来(当前支持的 Lua 版本是 5.2),其目的是遵循 C-Lua 实现并且合并完整的 .NET 框架支持。你可以很方便在 Lua 程序中调用 .NET 的 functions/classes/interfaces/events ,同时也可以轻松在 .NET 应用中调用 Lua 的变量和函数。
NeoLua 使用 C# 开发并使用 Dynamic Language Runtime. 目前 NeoLua 依赖于 .NET Framework 4,同时也支持当前版本的 Mono 框架。
What NeoLua is useful for
•Outsource the logic of your application into scripts
•Structuring of logic
•Build a dynamic configuration system, with functions and variables
•As a formula parser
•…
Advantages of NeoLua
•Dynamic access between Lua script and and the host application/.NET framework and vice-versa.
•NeoLua is based on the DLR. So you get compiled code that is collectable and well-optimized.
•It is compatible with the .NET world (e.g. C#, VB.NET, IronPython, …).
•Full and easy access to the .NET framework or your own libraries (with no stub code).
•A .NET Framework Garbage Collector that is well-tested and very fast.
•Pure IL (x86,x64 support)
示例代码:
using Neo.IronLua;
namespace Test
{
public static class Program
{
public static void Main(string[] args)
{
// Create the Lua script engine
using (Lua l = new Lua())
{
// create a Lua script environment (global)
var g = l.CreateEnvironment();
// run a chunk, first the code, than the name of the code
g.DoChunk(“print(‘Hello World!’);”, “test.lua”);
}
}
}
}
Lua 的 .NET 实现:NeoLua
===========================
http://baike.baidu.com/link?url=0Q6ZRtLqD7-sGqxoAnfEDx2EYJCluU54T1lgSswesXI2pSLBSVuaAe22p5VL61R_pzsCBDdieED-t4HJD6p0kK
http://www.open-open.com/lib/view/open1408005253192.html
NeoLua 使用 C# 开发并使用 Dynamic Language Runtime. 目前 NeoLua 依赖于 .NET Framework 4,同时也支持当前版本的 Mono 框架。
What NeoLua is useful for
•Outsource the logic of your application into scripts
•Structuring of logic
•Build a dynamic configuration system, with functions and variables
•As a formula parser
•…
Advantages of NeoLua
•Dynamic access between Lua script and and the host application/.NET framework and vice-versa.
•NeoLua is based on the DLR. So you get compiled code that is collectable and well-optimized.
•It is compatible with the .NET world (e.g. C#, VB.NET, IronPython, …).
•Full and easy access to the .NET framework or your own libraries (with no stub code).
•A .NET Framework Garbage Collector that is well-tested and very fast.
•Pure IL (x86,x64 support)
示例代码:
using Neo.IronLua;
namespace Test
{
public static class Program
{
public static void Main(string[] args)
{
// Create the Lua script engine
using (Lua l = new Lua())
{
// create a Lua script environment (global)
var g = l.CreateEnvironment();
// run a chunk, first the code, than the name of the code
g.DoChunk(“print(‘Hello World!’);”, “test.lua”);
}
}
}
}
Lua 的 .NET 实现:NeoLua
===========================
http://baike.baidu.com/link?url=0Q6ZRtLqD7-sGqxoAnfEDx2EYJCluU54T1lgSswesXI2pSLBSVuaAe22p5VL61R_pzsCBDdieED-t4HJD6p0kK
http://www.open-open.com/lib/view/open1408005253192.html
相关文章推荐
- 《Lua程序设计》9.3 以协同程序实现迭代器 学习笔记
- 《Lua程序设计》9.2 管道(pipe)与过滤器(filter) 包含使用协同函数实现“生产者——消费者”问题的实例代码
- 《Lua程序设计》9.1 协同程序基础 学习笔记
- ngx_lua入门
- LUA学习笔记(第5-6章)
- LUA学习笔记(第5-6章)
- 《Lua程序设计》第7章 迭代器与泛型for 学习笔记
- Lua 迭代器与closure
- 传Lua对象到Cpp
- 传Lua对象到Cpp
- 《Lua程序设计》第6章 深入函数 学习笔记
- Lua 正确的尾调用(proper tail call)
- Lua中的closure(闭合函数)
- premake构造工具- 使用premake工具生成工程文件
- Lua中强大的元方法__index详解
- 一个lua 与c交互的小demo
- 如何让EditPlus支持LUA
- 高效调用lua函数
- Lua学习笔记-table转为字符串
- 余额重估(Revaluation Balances)相关设置和操作