4 ms·
Very cool stuff. I wanted to start learning Lua. Is there any way to see your code?
by 616c 13y ago
Very cool stuff. I wanted to start learning Lua. Is there any way to see your code?
- spc476 13y agoWell, it's finicky. You'll need to install several custom written Lua modules [1]. These have been tested under Linux and Solaris. You will definitely have to edit the Makefile to exclude building some of the modules like org.conman.tcc [2] because of dependency issues (TCC isn't for the faint of heart). If you are on another Unix system, you'll probably be able to get most of it built (at the least, you'll need org.conman.process, org.conman.net and org.conman.pollset). You will also need to install LPeg [3]. Once all those are installed, then you'll be able to run the code: http://pastebin.com/ZBq5gSbS http://pastebin.com/ZBq5gSbS Or you can just look at the code: http://pastebin.com/ZBq5gSbS http://pastebin.com/ZBq5gSbS The coroutine stuff is there, just well hidden. I will also link to a sample multiuser chat room (no security, very basic): http://pastebin.com/u6vSPc69 http://pastebin.com/u6vSPc69 [1] https://github.com/spc476/lua-conmanorg https://github.com/spc476/lua-conmanorg [2] It's a Lua interface to the TCC library, which is a C compiler-as-a-library. Not used in the same code I posted, but it is something I find immensely useful, but I would classify as "advanced." [3] http://www.inf.puc-rio.br/~roberto/lpeg/ http://www.inf.puc-rio.br/~roberto/lpeg/ This is the Lua Parsing Expression Grammar library. If you are familiar with compiler tools, think lex and yacc (or flex and bison).