3 ms·
It would be neat to see how you could possibly hook Lua into this to give you some of the flexibility of a dynamic language with the speed and small footprint o
by compay 16y ago
It would be neat to see how you could possibly hook Lua into this to give you some of the flexibility of a dynamic language with the speed and small footprint of a (mostly) C app. I've been thinking of working on something like that for a while but unfortunately my C skills need a lot more work before I'd be comfortable tackling it.
- lhorie 16y agoHave you looked at Tir? http://tir.mongrel2.org/home http://tir.mongrel2.org/home
- compay 16y agoYeah, I wrote the test framework that Zed uses for Mongrel2 and Tir's unit tests, and also wrote the WSAPI handler for Mongrel2 (a separate project from Tir). What I'd really like to see is not so much a web framework in Lua (there are a few, I'm working on another one, and it's really not hard to make one either), but rather one that's mostly C but lets you use Lua, say, for templates or controller functions. That could be pretty interesting for very small devices, or for squeezing lots of performance out of a larger one, all while stilling letting you program the bulk of your code in a higher level language.
- DTrejo 16y agoCame across this the other day: Embed the Power of Lua into NginX https://github.com/chaoslawful/lua-nginx-module https://github.com/chaoslawful/lua-nginx-module
- 1337p337 16y agoThere's also AbsoLUAtion for Lighttpd. Lua's a very nice, convenient language for embedding dynamic/user-configurable bits in otherwise static applications. PowerDNS and nmap use it, too. It seems to have displaced Tcl as the de facto language for embedding.
- ay 16y agoLuajit2 approaches C on speed [1] - and with the newly released FFI library the C is not really needed that much - so, pretty much all the work has been already done. Just use the results of it :) [1] http://news.ycombinator.com/item?id=641313 http://news.ycombinator.com/item?id=641313
- compay 16y agoLuaJIT is awesome but it doesn't run on as many architectures as the original Lua VM. The nice thing about a framework in C is that you can install it anywhere it compiles, and if you stick to ANSI C like Lua does then it compiles pretty much anywhere, like Lua itself.
- ay 16y agoAgree, just x86 and x86_64 - though realistically, is there a lot of usage of other platforms for high-performance servers ? And if the server is not high-performing, mongrel2 + $something can be a very good choice. (And has a more liberal license). But of course, the tastes differ - so the more, the merrier. as soon as the folks do not get pwned.
- compay 16y agoI'm thinking of small devices like wireless routers, phones and maybe even wristwatches. I like the idea of having a full stack framework for web apps, served locally on a tiny device. You could reuse a lot of code that way and at least for phones, potentially avoid some of the cost of having a native app with totally different code from your web app. But yeah, LuaJIT recently added support PPC and soon will add ARM, so point well taken - to do what I'm thinking of, it may not really be necessary to have anything in C.