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

Suggestion: alternative process plugin communication format #760

Open
bradzacher opened this issue Oct 25, 2023 · 0 comments
Open

Suggestion: alternative process plugin communication format #760

bradzacher opened this issue Oct 25, 2023 · 0 comments

Comments

@bradzacher
Copy link

Binary communication is super duper performant as a communication style because it's as compact as can be. However it's also not something that's easy to do in a lot of languages.

For example - handling binary sent from stdin in JS is a pain in the butt.
I'd love to see an alternative specification that uses jsonlines as its message format. Whilst it is more IPC bytes sent/received - most languages have easily accessible JSON parsers and can easily construct objects from JSON.
It's also much easier to construct a plugin which does
"read line from stdin, parse json, action, json stringify response, write line to stdin"
rather than
"read 4 bytes from stdin, interpret as u32, read 4 bytes from stdin, interpret as u32, read 4 bytes from stdin, interpret as u32, read n bytes from stdin where n = last u32 read, read 4 bytes from stdin and assert it's [255,255,255,255], action, write 4 bytes to stdout........"


Another option that would maintain the binary format would be using a standardised, schema-backed binary format like protobuf/flatbuffers so that consumers can more easily generate the serialisation/deserialisation code rather than manually building and maintaining it.

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

1 participant