首页
登录 | 注册

lua源码阅读次序


Recommended reading order:
lmathlib.c, lstrlib.c: get familiar with the external C API. Don't bother with the pattern matcher though. Just the easy functions.

lapi.c: Check how the API is implemented internally. Only skim this to get a feeling for the code. Cross-reference to lua.h and luaconf.h as needed.

lobject.h: tagged values and object representation. skim through this first. you'll want to keep a window with this file open all the time.

lstate.h: state objects. ditto.

lopcodes.h: bytecode instruction format and opcode definitions. easy.

lvm.c: scroll down to luaV_execute, the main interpreter loop. see how all of the instructions are implemented. skip the details for now. reread later.

ldo.c: calls, stacks, exceptions, coroutines. tough read.

lstring.c: string interning. cute, huh?

ltable.c: hash tables and arrays. tricky code.

ltm.c: metamethod handling, reread all of lvm.c now.
You may want to reread lapi.c now.

ldebug.c: surprise waiting for you. abstract interpretation is used to find object names for tracebacks. does bytecode verification, too.

lparser.c, lcode.c: recursive descent parser, targetting a register-based VM. start from chunk() and work your way through. read the expression parser and the code
generator parts last.

lgc.c: incremental garbage collector. take your time.
Read all the other files as you see references to them. Don't let your stack get too deep though.

在线交叉阅读链接
http://www.lua.org/source/5.1/

相关文章

  • 阅读Java源码的前提条件: 1.技术基础 假如你从来都没有学过Java,也没有其它编程语言的基础,上来就啃<Core Java>,那样是很难有收获的,尤其是<深入Java虚拟机>这类书,或许别人觉得好,但是未必适合 ...
  • Java工程师学习指南 中级篇
    Java工程师学习指南 中级篇 最近有很多小伙伴来问我,Java小白如何入门,如何安排学习路线,每一步应该怎么走比较好.原本我以为之前的几篇文章已经可以解决大家的问题了,其实不然,因为我写的文章都是站在Java后端的全局上进行思考和总结的, ...
  • 新RTMFP流媒体服务器 MonaServer 源码编译安装-T
    MonaServer 源码编译安装   MonaServer 是Cumulus这个项目衍生出来的新项目,前身Cumulus在github中注明了Cumulus已经比较老,希望使用最新的RTMFP的server的话可以尝试MonaServer ...
  • Redis源码解析--NET
        关于Redis资料:     要看原滋原味的请点这里,要看有我参与的山寨货请点这里,当然我也不反对看这里.     在接下来的日子里,我会记录下我对Redis源码的一些认识,首先从Event driven programming l ...
  • 主要实现的功能有:         1.支持IP白名单和黑名单功能,直接将黑名单的IP访问拒绝(白名单权重高于黑名单).         2.支持URL白名单,将不需要过滤的URL进行定义.         3.支持User-Agent的过 ...
  • 之前的文章介绍了redis当中的模型,今天首先来拿字符串对象说说事~ 1. 设置命令 首先,redis定义了5个宏来确定当前设置的一些属性,具体如下 #define OBJ_SET_NO_FLAGS 0 #define OBJ_SET_NX ...

2019 unjeep.com webmaster#unjeep.com
12 q. 0.012 s.
京ICP备10005923号