Lua
cfy_yufeng
专注: 高性能,容错, 分布式服务器的研究和实现
信仰: 简单就是美
背景: 14年c开发经验, 12年网络开发经验, 3年Linux内核开发
提供服务器架构、诊断、优化咨询服务
Twitter: eric33yu@
Gmail/Gtalk: mryufeng@
欢迎大家多联系!
展开
-
你们有yum 我有LuaRocks
LuaRocksThis is LuaRocks, a deployment and management system for Lua modules.LuaRocks allows you to install Lua modules as self-contained packages called "rocks", which also contain version de...2008-06-26 21:38:19 · 244 阅读 · 0 评论 -
Yueliang + LuLu 完整的LuaInLua系统
Yueliang: http://yueliang.luaforge.net/IntroductionThe goal of Yueliang is to implement Lua 5 in Lua 5. Such a codebase, if well documented, can be a useful prototyping and educational tool. I...2008-07-21 11:43:06 · 287 阅读 · 0 评论 -
Notes about how the Lua garbage collector works
lua垃圾收集的原理 参见: http://lua-users.org/wiki/EmergencyGarbageCollectorNotes about how the Lua garbage collector worksDisclaimer: This is the first time I have worked on a garbage collector so some o...2008-07-22 00:46:57 · 108 阅读 · 0 评论 -
未公开的Lua Frontier Pattern %f 比较实用
参见: http://lua-users.org/wiki/FrontierPatternFrontier Pattern lua-users home wikiThe "frontier" expression pattern %f is undocumented in the standard Lua references (for reasons why see ...2008-07-23 17:57:34 · 405 阅读 · 0 评论 -
lua扩展模块里面如何申请内存
我们在编写lua模块的时候经常会遇到申请内存的情况,有2中用途 1。 临时的 2. 长期的。 通常我们是用malloc来分配内存 free来释放。但是这样做的话 lua runtime就没有办法跟踪内存的使用。但是我们有解决方法:1. 临时的 通过LuaL_Buffer来, 因为LuaL_buffer有自主扩展能力,所以我们可以存入很多数据 只是每次可以直接使用buffer的大小有限制。2...2008-07-25 12:35:54 · 755 阅读 · 0 评论 -
tail程序 c版本和lua版本大比拼
闲来的时候做了个tail 程序,和*nix下的tail功能一样Usage: ./tail -n nnnn filenamelua版本代码 20行, c版本代码173行,开发速度大概差5倍。代码效率:time tail -n 1000000 /var/log/haproxy.log >/dev/null 从log文件尾巴中抽取1000000行。1.linux 版本的t...2008-08-10 00:44:11 · 202 阅读 · 0 评论 -
lua源码研究阅读顺序
转自:[url]http://www.reddit.com/comments/63hth/ask_reddit_which_oss_codebases_out_there_are_so/c02pxbp[/url]Recommended reading order: * lmathlib.c, lstrlib.c: get familiar with the external ...原创 2009-11-25 14:27:30 · 199 阅读 · 0 评论 -
LuaJIT 2 beta 3 is out: Support both x32 & x64(为什么会如此快?)
LuaJIT's interpreter is fast, because:•It's written in assembler.•It keeps all important state in registers. No C compiler manages to do that on x86.•It uses indirect threading (aka labeled go...2010-03-08 16:59:35 · 184 阅读 · 0 评论 -
Lua三人帮出新书 Lua Programming Gems
[url]http://www.lua.org/gems/[/url]We are proud to announce that the book has been published: Lua Programming Gems。edited by L. H. de Figueiredo, W. Celes, R. Ierusalimschy2008-12-22 14:37:59 · 499 阅读 · 0 评论 -
luatcc 方便你写lua扩展
当要用c实现lua的模块的时候 就涉及到模块的编译 调试 运行 而这些步骤很繁琐,容易出错,有了luatcc就可以直接在lua代码里面直接写c代码了 动态运行 岂不是很cool, 大大提高了开发速度。luatcc项目网站: http://luaforge.net/projects/lua-tcc/require "lua_tcc"m = tcc.compile ([[...2008-07-18 22:21:43 · 377 阅读 · 0 评论 -
luacoco 增强lua的coroutine功能
Coco is a small extension to get True C Coroutine semantics for Lua 5.1.Coco is both available as a stand-alone release and integrated into LuaJIT.The stand-alone release is a patchset against...2008-07-04 16:41:14 · 244 阅读 · 0 评论 -
lua做tcp服务器的2套库
copas是纯lua的实现 依赖于luasocket, 但是毕竟大的现在,只能支持1024个并发,是select机制的限制。luaevent和copas的接口很像,基于libevent,支持epoll等,可以支持大规模的并发。copas经过几天几夜的测试, 比较稳定,但是吃比较多的内存。luaevent测试在进行中。注:在copas或者luaevent.loop 中...2008-07-04 15:37:48 · 377 阅读 · 0 评论 -
lua newproxy用途
What does newproxy() in 5.1?> I find newproxy a curious addition. It gives you unique userdata that> share the same metatable. I cannot think of a use for it yet.> What did you have in mind?...2008-06-27 01:02:00 · 537 阅读 · 0 评论 -
luaedit 新版本 支持lua5.1 马上要发布
Announcing LuaEdit 2008 and new website Jean-François Goulet - 2008-06-24 21:14 - LuaEditLuaEdit is getting a whole new look with the upcoming version of LuaEdit 2008 which will support the...2008-06-27 01:53:14 · 197 阅读 · 0 评论 -
Alien - Pure Lua extensions
What is AlienAlien is a Foreign Function Interface (FFI) for Lua. An FFI lets you call functions in dynamic libraries (.so, .dylib, .dll, etc.) from Lua code without having to write, compile and l...2008-06-27 02:19:50 · 158 阅读 · 0 评论 -
Lua For Windows v5.1.3.11 Release Candidate 1
Lua For Windows v5.1.3.11 Release Candidate 1 Andrew Wilson - 2008-06-28 00:19 - Lua for WindowsWe are proud to announce the first release candidate of Lua for Windows (LfW). This moves thi...2008-06-30 11:41:19 · 144 阅读 · 0 评论 -
RemDebug小巧的Lua远端调试器 告诉你coroutine很强大
RemDebug is a remote debugger for Lua 5.0 and 5.1. It lets you control the execution of another Lua program remotely, setting breakpoints and inspecting the current state of the program. RemDebug can ...2008-06-30 14:47:24 · 385 阅读 · 0 评论 -
LPeg Parsing Expression Grammars For Lua, version
IntroductionLPeg is a new pattern-matching library for Lua, based on Parsing Expression Grammars (PEGs). In this text, I assume you are familiar with PEGs. If you are not, you can get a quick star...2008-06-16 12:05:06 · 145 阅读 · 0 评论 -
lua coroutine是如何实现的?
一直对coroutine的运作原理不是很明白, 这几天琢磨了下终于搞明白了:root@yfnix:~/lua-5.1.3/src# cat t.lua a= coroutine.create(function () b= coroutine.create(function () coroutine.yield(1) ...2008-07-03 12:47:23 · 430 阅读 · 0 评论 -
lua symbexec的2个用途
原型: static Instruction symbexec (const Proto *pt, int lastpc, int reg);symbexec 是安装vm的执行流程来模拟一段opcode的执行, 执行到lastpc, 同时返回修改reg的那条指令。有2个用途1. loadstring检查代码是否被篡改,是否合法 2. 用于lua_getinfo的时候 看...2008-07-04 11:40:29 · 142 阅读 · 0 评论 -
《Beginning Lua Programming》新鲜出炉
[url=http://blog.zhuzhaoyuan.com/]老朱同学[/url]给我的: 《Beginning Lua Programming》 粗看了下 好像还不错!参看: http://www.amazon.com/Beginning-Lua-Programming-Programmer/dp/0470069171 的评价!有兴趣的同学可以读读!可以google下,找到pd...2009-02-10 14:52:35 · 153 阅读 · 0 评论