`
lua
  • 浏览: 76378 次
  • 性别: Icon_minigender_1
  • 来自: 大连
文章分类
社区版块
存档分类
最新评论

Lua code reading

阅读更多

Online Lua 5.1 source code browser

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.

If you're done before X-Mas and understood all of it, you're good. The information density of the code is rather high.

分享到:
评论

相关推荐

    lua_code.zip_Lua嵌入_exe-hreader_lua_lua c_lua c++

    在"lua_code.zip"这个压缩包中,"code"目录可能包含了示例代码,展示了如何在C/C++程序中嵌入Lua。以下是一些基本步骤: 1. **初始化Lua环境**:首先,你需要调用`luaL_newstate()`创建一个新的Lua状态机,这是执行...

    lua-5.3.1 code

    在这个"lua-5.3.1 code"压缩包中,包含的是Lua 5.3.1版本的源代码,适用于Linux操作系统。 Lua 5.3.1是Lua语言的一个重要版本,它在5.3系列中引入了许多新的特性和改进。这个版本的主要亮点包括: 1. **增强的数值...

    lua source code with VC2015 project files

    标题 "lua source code with VC2015 project files" 暗示了这是一个包含 Lua 编程语言源代码以及适用于 Visual Studio 2015 的项目文件的资源包。Lua 是一种轻量级的脚本语言,常用于游戏开发、嵌入式系统以及各种...

    lua_reading:lua源码阅读

    《lua_reading: 深入理解lua源码阅读》 lua是一种轻量级的脚本语言,因其简洁、高效的特点,在游戏开发、嵌入式系统和服务器配置等领域广泛应用。lua5.3.5是lua的一个稳定版本,对于深入理解lua的机制和内部运作...

    luaQrcode lua语言生成二维码

    **luaQrcode:使用Lua语言生成二维码** 在IT行业中,二维码已经成为数据交换和信息展示的常见方式,尤其在移动设备上。luaQrcode是这样一个工具,它允许开发人员使用Lua编程语言来生成二维码,从而扩展了Lua的应用...

    LUAC脚本解密_luac解密在线_luac4加密_luac反编译_luac4解密工具_luac解密工具

    LUAC脚本是一种基于Lua语言的编译格式,它将Lua源代码编译成字节码,以便在 Lua 解释器上高效运行。LUAC(Lua Compiler)是Lua官方提供的编译器,它将源代码转换为这种优化的字节码,以提高执行速度。在游戏开发、...

    所有版本LUA源码

    所有版本LUA源码 lua-5.3.5 lua-5.3.4 lua-5.3.3 lua-5.3.2 lua-5.3.1 lua-5.3.0 lua-5.2.4 lua-5.2.3 lua-5.2.2 lua-5.2.1 lua-5.2.0 lua-5.1.5 lua-5.1.4 lua-5.1.3 lua-5.1.2 lua-5.1.1 lua-5.1 lua-5.0.3 lua-...

    luacodeEditor2

    基于https://github.com/dansen/luacode 修改的版本。增强如下: 1、增加自定义API的支持;使用文本文件定义自己的API(包括类对象(lua中叫 userData)),格式很简单; 2、对自动完成和函数提示作了较多的增强;...

    LUAC反编译_LUC_lua反编译工具_luac_luac解密工具_Lua解密_

    Lua源代码是文本形式的,易于阅读和编写,但为了保护代码不被轻易篡改或盗用,开发者通常会将Lua代码编译成字节码(.lua.c文件或.luac文件)。"LUAC"就是Lua的官方编译器,它将Lua源代码转换为字节码,以提高执行...

    lua51-lua环境

    Lua 5.1.4是Lua编程语言的一个版本,它是一个轻量级的脚本语言,广泛用于游戏开发、嵌入式系统、服务器配置等多种领域。这个压缩包提供了在Windows环境下运行和开发Lua程序的基本组件。 首先,我们来了解一下Lua ...

    LUAC解密工具.zip_andlua解密工具_andlua解密软件_lua 4.2解密_luac转lua_lua解密工具

    "LUAC解密工具"就是针对Lua编译后的二进制文件(.luac)进行解密的工具,目的是为了让加密过的Lua代码能够恢复成可读的源代码格式(.lua)。 LUAC是Lua的编译器,它将Lua源代码转换为字节码,这个过程通常是为了...

    Lua-Code:Lua 中的有用代码

    在"Lua-Code: Lua 中的有用代码"这个项目中,我们可以看到它聚焦于两个核心概念:Delaunay三角剖分和Voronoi分解。这两个概念是几何计算和图形学中的重要算法,广泛应用于地图生成、物理模拟、图像处理等多个领域。 ...

    x-code 显示lua代码

    标题 "x-code 显示lua代码" 指的是在X-code这款强大的集成开发环境中配置和使用Lua语言的编码支持。X-code通常是Apple开发者用于构建iOS、macOS等平台应用程序的首选工具,但它同样能用于编写和调试其他类型的代码,...

    lua加密成luac工具

    ios版本将lua加密成luac

    lua_stm32f4.rar_lua stm32_lua移植stm32_stm32 lua_stm32f407移植lua_st

    《Lua在STM32F407上的移植与应用》 在嵌入式系统领域,为了提高代码的可读性、可维护性和灵活性,越来越多的开发者选择使用高级脚本语言,如Lua,来替代传统的C/C++编程。本文将详细探讨如何在STM32F407微控制器上...

    luaDll+ luacom+luaiconv.rar

    内含luaDll,luacom以及luaiconv源码。luaDll和luaiconv直接打开sln在Visual studio中即可进行编译。luacom可使用nmake进行编译。也可直接使用已经生成了的dll.

    Lua中文编辑器luaEditor

    Lua是一种轻量级的脚本语言,常用于游戏开发、嵌入式系统和服务器配置等领域。LuaEditor是一款专为Lua编程设计的中文编辑器,它为程序员提供了方便的开发环境,提高了编写和调试Lua代码的效率。luaEditor-v4.10是该...

    Lua的最基本使用 C++与lua的互相调用

    使用`lua_pushnumber`、`lua_pushstring`等函数将C++数据推送到Lua栈,使用`lua_tonumber`、`lua_tostring`等函数从Lua栈获取数据。 6. 清理:调用`lua_settop(L, 0)`清空栈,防止内存泄漏。 二、Lua调用C++函数 ...

    易语言lua的例子

    4. **Lua.dll**:这是Lua51.DLL,是Lua解释器的核心部分,包含了Lua的所有运行时功能。在易语言中,可以通过动态链接这个DLL来调用Lua的功能。 5. **测试.e**:这是一个易语言的源代码文件,很可能包含了如何在...

    luacodeEditor

    基于https://github.com/dansen/luacode 修改的版本。增强如下: 1、增加自定义API的支持;使用文本文件定义自己的API(包括类对象(lua中叫 userData)),格式很简单; 2、对自动完成和函数提示作了较多的增强;...

Global site tag (gtag.js) - Google Analytics