Files
LuaCangjia_api/doc/ADAPTATION-lua25.md
JianFeeeee f2deb81e4a vendor: 引入 Lua 2.5 官方源码 + 移植评估 (lua_2.5 分支)
- 前 lua_State 时代 API, 比 3.2 更原始(无 upvalue/无独立编译)
- 评估结论: 不建议移植(多实例冲突+管道模式不可实现), 见 doc/ADAPTATION-lua25.md
- 建议历史脚本用 5.1 兼容模式运行替代
2026-08-25 10:20:25 +08:00

20 lines
972 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Lua 2.5 分支移植评估ADAPTATION.md
> 本分支已 vendor Lua 2.5 官方源码到 `lib/lua/`src/ + include/)。
> **桥接层尚未适配,且不建议移植。**
## 结论:不建议移植
Lua 2.51996与 Lua 3.2 同属"前 lua_State 时代",且比 3.2 更原始:
1. **全局单例状态机** —— `lua_open(void)` 无参数无句柄,与本项目多 runner 实例抽象根本冲突
2. **fallback 机制而非 metatable** —— 面向对象模型完全不同
3. **无独立编译** —— `lua_dofile(char*)` 一步式,管道模式的块压栈不可实现
4. **upvalue 语义缺失** —— 闭包模型尚未引入3.1 才有 upvalue
5. 1996 年代码现代编译器需多处修正才能通过K&R C 残留)
若确需支持历史脚本,建议直接用 Lua 5.1 的兼容模式跑(语法子集大部分兼容),
或参考 lua_3.2 分支的评估做极简 doString-only 桥接。
本分支仅作为源码存档。