在C#中使用Lua的最有效方法是什么?

编程入门 行业动态 更新时间:2024-10-10 05:20:04
本文介绍了在C#中使用Lua的最有效方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

据我所知,Lua是一种可嵌入的脚本语言,可以对对象执行方法.有哪些陷阱要避免?将Lua用作解释器并在Web环境或规则引擎中执行方法是否可行?

From my understanding, Lua is an embeddable scripting language that can execute methods on objects. What are the pitfalls to avoid? Is is it feasible to use Lua as an interpreter and execute methods in an web environment or as a rule engine?

推荐答案

Lua非常快-脚本可以预编译为字节码,并且函数可以在接近C ++虚拟方法调用的情况下执行.这就是为什么在游戏行业中将其用于脚本AI,插件和其他高级游戏脚本的原因.

Lua is very fast - scripts can be precompiled to bytecodes and functions execute close to C++ virtual method calls. That is the reason why it is used in gaming industry for scripting AI, plugins, and other hi-level stuff in games.

但是您将C#和Web服务器放在了问号中.

But you put C# and web server in your question tags.

如果您不打算使用嵌入式Web服务器,那么Lua并不是很强大. Lua是ANSI C-它可以编译为本机代码,因此,它既不欢迎您的asp服务器,也不欢迎您的C#代码.考虑中等信任"或绑定"或"64位".

If you are not thinking of embedded web servers - than Lua is not very strong. Lua is ANSI C - it compiles to native code, and as such it is not very welcome to your asp server, nor to your C# code. Think of "medium trust" or "binding" or "64bit".

足够的陷阱.如果您已经准备好使用C#,则没有理由在Web服务器上避免使用它.它被编译和缓存.它托管着像这样的大型网站.

Enough of pitfalls. If you are allready using C#, there is no reason to avoid it on web server. It gets compiled and cached. It servers huge sites like this one.

更多推荐

在C#中使用Lua的最有效方法是什么?

本文发布于:2023-11-30 09:50:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1649557.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:最有效   方法   Lua

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!