Here is the case, I want to implement a proxy for array in luajit environment with __index and __newindex that read write data in another table.
However, luajit which is lua5.1 doesn't support __len __ipair metamethod, and length operator #, global next function, global ipairs function would return wrong result on proxy.
Then I come up with an idea that write a printer plugin that print # next ipairs into some custom implementation, but this plugin would ignore code in lualib.
I think the problem is, the plugin doesn't give user enough power to modify the compilation process, since lualib are already compiled before plugin taking over.