Hello Luiz,
Yeah, it can be done. I can do it. But in simple words "proposal" means
at least "I want you think about it." (Implying "I want to get analysis
response" and even "I want _you_ do it" in some cases. But my flavor
of this proposal is just "think".)
That's what inside "standard" library mainly determines what kind
of projects are written in this language.
You wrote "string.unpack"? I wrote ZIP file parser using it.
We have metatables? People using them for fancier code.
We have coroutines? People creating whole frameworks on them.
From the other hand we have "table.reverse". We had hyperbolic cosine.
Once thing is included it's almost impossible to remove it. Because
code from couple of other guys relies on it. And "breaking changes"
are bad for reputation. So you have to maintain it forever.
And also Lua design refuses to "eat it's own dogfood". It refuses to use
tables. See "package.path" and "package.config". (But I think such design
is for pyuer C functions.)
So that's problem with my proposal as it suggests to return list of lists.
And for sure next thing somebody would ask will be bytecode compiler for
that structure. And then some promising student will config fuzzer for
it and will try to issue dozens of CVEs and become respected security
expert. But "debug"'s library "unsafe" clause will will protect us.
As it protected from "setupvalue" fuzzers from another promising students.
I believe several people already wrote their own bytecode compiler/
decompiler. LuaJIT and Fengari at least. TinyLuaCompiler uses v5.1 opcodes.
Luac.Nl is probably scanning text output for extracting them.
It's always project specific and so fragile and without guarantees.
And writing such codec is not a light work.
If it already was in standard library probably authors would spend
energy on writing more higher-level code.
And having bytecode parser in machine-friendly format increases portability.
Because execution can be delegated and thus managed.
-- Martin