Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept Lua tables as arguments and serialize to json in c land #1

Open
britzl opened this issue Mar 16, 2018 · 1 comment
Open

Accept Lua tables as arguments and serialize to json in c land #1

britzl opened this issue Mar 16, 2018 · 1 comment
Labels
new feature New feature

Comments

@britzl
Copy link
Contributor

britzl commented Mar 16, 2018

Currently the communication from Lua to JS via C requires complex data structures (Lua tables) to be serialized to JSON in Lua before passed on as a string to the extension and deserialized again in Javascript. The same process but in reverse goes for complex responses from Javascript back to Lua.

The preferred solution is to pass Lua tables to C and let the C code serialize to JSON. Currently there's no support for serializing a Lua table to JSON from C.

Task: Evaluation of JSON parsers in C. Integrate with extension.

Perhaps Lua table to JSON and back again should be part of the DMSDK?

@britzl
Copy link
Contributor Author

britzl commented Mar 17, 2018

We use jsmn internally for json.encode(). This, together with a json.decode() from a yet to be decided lib, should be externalised and made available as part of DMSDK.

@britzl britzl added the new feature New feature label Mar 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature
Projects
None yet
Development

No branches or pull requests

1 participant