Page 1 of 1

Expose JSON API to mods

Posted: Mon Jun 22, 2020 3:20 pm
by Zomis
Parts of Factorio are already using JSON. Considering how well-known the format is and the fact that some mods already have their own JSON implementation, I'd like to see a JSON serialization/deserialization API exposed for modders to use. I bet that performance-wise it is much more efficient to do it in C++ than in Lua - both creating the JSON and iterating through the Lua table/value to be serialized.

Therefore, I'd like to see a JSON API exposed for modders to use.

Re: Expose JSON API to mods

Posted: Mon Jun 22, 2020 3:24 pm
by posila
You need to be more specific, because I am not sure if you are not aware of these: https://lua-api.factorio.com/latest/Lua ... le_to_json or that's not what you want.

Re: Expose JSON API to mods

Posted: Mon Jul 27, 2020 2:18 pm
by Zomis
Huh, thanks, I was not aware of these. It does indeed look like exactly what I was looking for!

And here I thought I was coming up with something new... you folks think of everything :)