Closed mckaydavis closed 6 years ago
Hi @mckaydavis (again :) )
Well, in the begining i was using cjson, but than i had switched to rapidjson due to lack of support of empty arrays. In cjson you can globaly configure to encode lua empty tables as objects or as arrays. But wiola needs to encode different empty tables differently.
I've got a look into open resty fork, and it has a empty_array
and empty_array_mt
things, which is good replacement for rapidjson setmetatable({}, { __jsontype = 'object' })
Will be great, if you can make a PR with that ;)
And another one reason for using rapidjson — *cjson lacks support for big integers (> 32 bit)
I propose replacing the lua-rapidjson package dependency with lua-cjson.
Rationale:
luarocks install rapidjson
is further complicated as that requires a compiler and CMake >= 3.0.0 to be installed to buildlua-rapidjson
from source.cjson.so
binary is 95% smaller than therapidjson.so
binary:.encode
and.decode
) it is a straight drop-in replacement with minimal code change. My preliminary testing after query-replacing allrequire "rapidjson"
->require "cjson"
in src/wiola/wiola.lua seems to work fine.Thoughts?