Which programming languages support hot code swapping and/or sandboxing?

*爱你&永不变心* 提交于 2019-12-20 12:46:10

问题


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.


回答1:


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).




回答2:


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 :/.



来源:https://stackoverflow.com/questions/2106385/which-programming-languages-support-hot-code-swapping-and-or-sandboxing

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