(sometimes AI explains it better)
| Created | Updated | Size | License |
|---|---|---|---|
| 2017-05 | 2026-06 | < 50 K | LGPL3 |
Serialize data in Lua table to string with Lua code that recreates this data.
Lua tables can contain cross-references, so actually it's graph encoder to Lua code.
I'm using it as data exploration tool. Also it's very handy at debugging Lua code.
t2s = require('serialize_lua_graph')
print(t2s(_G))Options is optional table that can be passed as second argument
to function. That's Lua table with values like { style = 'readable_short' }.
We'll demonstrate behavior on excerpt of _G table printout.
Serializer function supports three encoding styles: minimal,
readable_short and readable_long.
style |
Output |
|---|---|
minimal |
local T_1={bit32={arshift='function: 0x557703aab060', |
readable_short |
local T_1 = { bit32 = { arshift = 'function: 0x55da5d825060', |
readable_long |
local T_1 = { |
bit32 = { |
|
arshift = 'function: 0x5595744ae060', |
Serializer function supports three behavior flags:
| Behavior flag | Output |
|---|---|
☑ use_compact_indices |
package = T_2, |
☐ use_compact_indices |
['package'] = T_2, |
☑ use_compact_sequences |
searchers = { 'function: 0x56089fbeba20' |
☐ use_compact_sequences |
searchers = { [1] = 'function: 0x5580fdeb8a20' |
☑ omit_tail_delimiter |
xpcall = 'function: 0x5612c12e1e90' } |
☐ omit_tail_delimiter |
xpcall = 'function: 0x55b2598d9e90', } |
- Lua 5.3 (or 5.4, 5.5)
- Save file
serialize_lua_graph.luafromdeploy/ - Place it to your Lua workplace for
require()
- Clone repo
- Modify files in
src/
- Clone
workshoprepo - Checkout it to date near
2026-06-20 - Modify
package.pathinbuilder/create_deploy.luaso it can find your clonedworkshoprepo - Run
builder/rebuild.sh
workshop-- My personal Lua framework on which this tool is based- My other projects