哪些编程语言支持热代码交换和/或沙箱?

发布于 2024-08-18 18:45:57 字数 193 浏览 12 评论 0原文

我想编写一个基于网络的 MMO 游戏,允许用户编写 AI 并将其作为游戏的一部分运行。我计划使用 Html5 进行图形处理,并希望它是基于 Web 的,以便可以从智能手机访问。我需要找到一种支持沙箱、并发、热代码交换和大型库的编程语言,以使事情变得更容易。

目前我的研究方向是 Erlang、Stackless Python 和 Lua。任何帮助表示赞赏。

I would like to write a web based MMO game that will allow users to write AI and run it as part of the game. I plan to use Html5 for graphics and want this to be web based so it can be accessed from smartphones. I need to find a programming language that will support sandboxing, concurrency, hot code swapping, and a large library to make things easier.

At this time my research is turning up Erlang, Stackless Python, and Lua. Any help is appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

樱花落人离去 2024-08-25 18:45:57

Erlang 支持沙箱,因此您可能不想使用它,至少对于您的脚本语言来说是这样。无论如何,Erlang 并不适合编写脚本,所以这可能没问题。

然而,Erlang 为这样的项目提供良好的后端语言,根据个人经验,我强烈推荐它。

我认为 Stackless 也不支持沙箱,所以这也可能不在列表中。

另一方面,Lua 明确支持沙箱,并且也有协程:http://lua-users。 org/wiki/SandBoxeshttp://lua-users.org/wiki/CoroutinesTutorial,所以我建议您使用它作为脚本语言。

Lua 也非常容易嵌入,如这个小教程所示: http://heavycoder.com/tutorials/lua_embed .php (您甚至可以在没有所有库加载内容的情况下逃脱,因为无论如何您都希望将其沙箱化)。

Erlang does not support sandboxing, so you probably don't want to use that, at least for your scripting language. Erlang isn't ideal for scripting anyway, so that's probably ok.

Erlang would make a good backend language for a project like this, however, and I'd highly recommend it from personal experience.

I don't think Stackless has sandboxing support either, so that's probably also off the list.

Lua, on the other hand, explicitly supports sandboxing, and has coroutines, too: http://lua-users.org/wiki/SandBoxes, http://lua-users.org/wiki/CoroutinesTutorial, so I would recommend that for your scripting language.

Lua is also extremely easy to embed as seen in this tiny tutorial: http://heavycoder.com/tutorials/lua_embed.php (and you can even get away without all the library loading stuff since you'll want to be sandboxing it anyway).

很酷又爱笑 2024-08-25 18:45:57

我也会选择 Lua,因为它具有荒谬的可定制性和多功能性(如果你不喜欢它的语法,你可以 更改它 到函数式或类似 python 的函数)。正如前面的答案中所述,您拥有沙箱和强大的并发性。我个人从来不会考虑嵌入 Lua 之外的任何东西;>。

然而,Lua 缺乏扩展的标准库,而这正是 Python 赢得巨大胜利的地方:/。

I'd also go with Lua due to it's absurd customizability and versality (if you don't like it's syntax you can change it to a functional or a python-like one). As said in the previous answer, you've got sandboxing and strong concurrency. I personally would never even think of embedding anything else than Lua ;>.

However, Lua lacks a expanded standard library, and this is where Python wins big time :/.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文