{"id":13779883,"url":"https://github.com/Manistein/dummylua-tutorial","last_synced_at":"2025-05-11T13:31:28.436Z","repository":{"id":37387402,"uuid":"153052447","full_name":"Manistein/dummylua-tutorial","owner":"Manistein","description":"这是一个仿制lua解释器的项目，我希望通过逐步实现lua解释器的各个部分，更加深刻地掌握lua的基本结构和运作原理。","archived":false,"fork":false,"pushed_at":"2023-04-26T07:31:29.000Z","size":21332,"stargazers_count":405,"open_issues_count":1,"forks_count":63,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-08-03T18:14:26.857Z","etag":null,"topics":["interpreter","lab","lua"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Manistein.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-10-15T04:17:50.000Z","updated_at":"2024-07-29T16:32:24.000Z","dependencies_parsed_at":"2024-01-17T01:43:56.902Z","dependency_job_id":null,"html_url":"https://github.com/Manistein/dummylua-tutorial","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manistein%2Fdummylua-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manistein%2Fdummylua-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manistein%2Fdummylua-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manistein%2Fdummylua-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Manistein","download_url":"https://codeload.github.com/Manistein/dummylua-tutorial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225056748,"owners_count":17414200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["interpreter","lab","lua"],"created_at":"2024-08-03T18:01:10.197Z","updated_at":"2024-11-17T15:30:46.717Z","avatar_url":"https://github.com/Manistein.png","language":"C","readme":"## 注意\n本系列博客不再更新，欢迎大家关注我的新书《Lua解释器构建：从虚拟机到编译器》，随书源码地址点击[这里](https://github.com/Manistein/let-us-build-a-lua-interpreter)，也欢迎大家到[官方旗舰店](https://item.m.jd.com/product/13807126.html?gx=RnExlzJaOzKPydRP--twWzz4fQ1sgoXIajtG\u0026ad_od=share\u0026utm_source=androidapp\u0026utm_medium=appshare\u0026utm_campaign=t_335139774\u0026utm_term=Wxfriends)购买。\n\n## 项目简介\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;lua是一门精妙简洁，而功能强大的语言，学习和掌握它的核心机制有着重要的意义。这是一个仿制lua解释器的项目(参照的版本是Lua5.3)，我希望通过逐步实现lua解释器的各个部分，更加深刻地掌握lua的基本结构和运作原理。本项目将分为多个部分完成，并为每一个部分附上一篇博文为该部分的设计和实现进行解析。开发这个项目的目的，并不是做一个能用于生产环境的lua解释器，而是尝试追寻前辈的步伐，尽最大可能理解其设计lua语言的思路，理解其中的关键细节。这是一个探索原理的旅程，因此效率并不是本项目要考虑的关键因素。这里我遵循的是\"FIRST  make  it  run, THEN make it run fast\"的原则，先让它跑起来。  \n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;本项目采取和官方版本的近似的命名规范，并尽最大努力遵循lua官方的设计主线。由于开发过程是我自己重新手写的，因此不会在所有细节和官方版本保持一致。同时这是一份参考资料，主旨是提供一条主线，不建议只跟随本旅程来研究lua。最终希望回到研究lua官方源码的道路上。  \n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;本系列将会为一些观点，理论附注上引证来源，并在Reference上展示，最后本人水平有限，如果有错误的地方，希望大家联系我加以指正。同时欢迎大家加入我创建的qq群185017593一起讨论技术。  \n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;系列内容，将在我的博客上展示，欢迎大家关注我的[blog](http://manistein.club/)。\n\n## 系列内容([地址](https://manistein.github.io/blog/tags/let-us-build-a-lua-interpreter/))\n* Part1：[虚拟机的基础--Lua基本数据结构、栈和基于栈的C函数调用的设计与实现](https://manistein.github.io/blog/post/program/build-a-lua-interpreter/%E6%9E%84%E5%BB%BAlua%E8%A7%A3%E9%87%8A%E5%99%A8part1/)\n* Part2：[Garbage Collection基础架构](https://manistein.github.io/blog/post/program/build-a-lua-interpreter/%E6%9E%84%E5%BB%BAlua%E8%A7%A3%E9%87%8A%E5%99%A8part2/)\n* Part3：[String设计与实现](https://manistein.github.io/blog/post/program/build-a-lua-interpreter/%E6%9E%84%E5%BB%BAlua%E8%A7%A3%E9%87%8A%E5%99%A8part3/)\n* Part4：[Table设计与实现](https://manistein.github.io/blog/post/program/build-a-lua-interpreter/%E6%9E%84%E5%BB%BAlua%E8%A7%A3%E9%87%8A%E5%99%A8part4/)\n* Part5：[脚本运行基础架构的设计与实现](https://manistein.github.io/blog/post/program/let-us-build-a-lua-interpreter/%E6%9E%84%E5%BB%BAlua%E8%A7%A3%E9%87%8A%E5%99%A8part5/)\n* Part6：[词法分析器设计与实现](https://manistein.github.io/blog/post/program/let-us-build-a-lua-interpreter/%E6%9E%84%E5%BB%BAlua%E8%A7%A3%E9%87%8A%E5%99%A8part6/)\n* Part7：[构建完整的语法分析器（上）](https://manistein.github.io/blog/post/program/let-us-build-a-lua-interpreter/%E6%9E%84%E5%BB%BAlua%E8%A7%A3%E9%87%8A%E5%99%A8part7/)\n* Part8：[构建完整的语法分析器（下）](https://manistein.github.io/blog/post/program/let-us-build-a-lua-interpreter/%E6%9E%84%E5%BB%BAlua%E8%A7%A3%E9%87%8A%E5%99%A8part8/)\n* Part9：[metatable](https://manistein.github.io/blog/post/program/let-us-build-a-lua-interpreter/%E6%9E%84%E5%BB%BAlua%E8%A7%A3%E9%87%8A%E5%99%A8part9/)\n* Part10：[userdata](https://manistein.github.io/blog/post/program/let-us-build-a-lua-interpreter/%E6%9E%84%E5%BB%BAlua%E8%A7%A3%E9%87%8A%E5%99%A8part10/)\n* Part11：[upvalue](https://manistein.github.io/blog/post/program/let-us-build-a-lua-interpreter/%E6%9E%84%E5%BB%BAlua%E8%A7%A3%E9%87%8A%E5%99%A8part11/)\n* Part12：[weektable](http://manistein.club/post/program/let-us-build-a-lua-interpreter/%E6%9E%84%E5%BB%BAlua%E8%A7%A3%E9%87%8A%E5%99%A8part12/)\n* Part13：require机制\n* Part14：热更新原理\n* Part15：再谈GC\n* Part16：尾声\n\n## 编译与运行\n\n#### 获取仓库\n```\ngit clone git@github.com:Manistein/dummylua-tutorial.git\n```\n\n#### 在Linux和Mac上编译与运行\n```\ncd dummylua-tutorial/\ncd linux/\ncd part01/\nmake\n\ncd bin/\n./dummylua\n```\n\n#### 在Windows上编译与运行\n* 进入dummylua-tutorial/windows/project/\n* 使用VS2013或以上版本打开工程\n* 自行编译和运行\n\n## 测试平台\n* Linux（Ubuntu）\n* Windows\n* Mac\n\n## Star History\n[![Star History Chart](https://api.star-history.com/svg?repos=Manistein/dummylua-tutorial\u0026type=Date)](https://star-history.com/#Manistein/dummylua-tutorial\u0026Date)\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FManistein%2Fdummylua-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FManistein%2Fdummylua-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FManistein%2Fdummylua-tutorial/lists"}