Skip to content

Suggestion: let OB C/C++(?), via ffi, parse the generated JSON and consume the model parameters for all the languages! #121

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

Closed
Buggaboo opened this issue Sep 29, 2020 · 1 comment

Comments

@Buggaboo
Copy link
Contributor

Buggaboo commented Sep 29, 2020

If there seems to be a uniform JSON model, why not let the C just consume it to generate the proper models, then poop out the updates to the parameters again (in JSON)?

We can get rid of model-related boilerplate in all languages.

I believe flatcc (dependency?) already has a JSON parser.

Even crazier idea: use flatbuffers, instead of JSON, so its (allegedly) backwards compatible, if that's an issue.

@vaind
Copy link
Contributor

vaind commented Jan 11, 2021

This has been discussed previously but isn't planned (for now) because any JSON loading would:

  • mean you have to distribute the model.json with your app, be it as a file or part of the source code (as a string)
  • be slower than a model constructed using classes - which the compiler can optimize/inline. Note: this isn't currently done in Dart either and we're still using some JSON parsing here but that should go away in the future

@vaind vaind closed this as completed Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants