lua 的 Node.js?

标签 node.js lua libevent

过去几天我一直在玩 node.js (nodejs),这太棒了。据我所知,lua 没有类似的 libev 和 libio 集成,这让我们避免了几乎任何阻塞调用并以异步方式与网络和文件系统交互。

我正在慢慢将我的 java 实现移植到 nodejs,但令我震惊的是 luajit 比 v8 JavaScript 快得多并且使用的内存少得多!

我想在这样的环境中编写我的服务器(非常快速且响应迅速,内存使用量非常低,非常有表​​现力)将极大地改进我的项目。

作为 lua 新手,我只是不确定是否存在这样的事情。我将不胜感激。

谢谢

最佳答案

最近对应的项目是Luvit "(Lua + libUV + jIT = pure awesomesauce)"。

来自 announcement :

this is basically luajit2 + libuv (the event loop library behind nodejs). It compiles as a single executable just like nodejs and can run .lua files. What makes it different from the stock luajit distribution is it has several built-in modules added and some slightly different semantics.

Notice that we're not running as a CGI script to apache or anything like that. The lua script is the http server. You get your callback called every time an http request is made to the server.

关于lua 的 Node.js?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2985388/

相关文章:

javascript - Node.js:使用 VCR 进行测试

arrays - Lua:table.remove 不适用于二维数组

c - Libevent:如何暂时禁用,然后重新启用 EV_READ? (在 C 中)

javascript - 如何在 NodeJS 中持续轮询 API 以获得特定结果?

mysql - SequelizeBase错误: ER_CANT_CREATE_TABLE in Node App

lua - 你如何在 Lua 中进行 Fisher-Yates shuffle

c++ - Qt 和 LibEvent 中信号和槽的区别

sockets - libevent如何检测到套接字已关闭

node.js - 使用 node.js 时是否有很好的 V8 命令行参数引用

lua - torch mist 简单