3 ms·
There are a world of serialization formats that can offer a similar interoperability story to JSON or JSON-but-binary formats. And sure, implementing them in ev
by jchw 2y ago
There are a world of serialization formats that can offer a similar interoperability story to JSON or JSON-but-binary formats. And sure, implementing them in every language that someone might be interested in using them in might require complication, but:
- Whatever: people in more niche languages are pretty used to needing to do FFI for things like this anyhow.
- Many of them already have a better ecosystem than D-Bus. e.g. interoperability between Protobuf and Cap'n'proto implementations is good. Protobuf in most (all?) runtimes supports dynamically reading a schema and parsing binary wire format with it, as well as code generation. You can also maintain backwards compatibility in these formats by following relatively simple rules that can be statically-enforced.
- JSON and JSON-but-binary have some annoying downsides. I really don't think field names of composite types belong as part of the ABI. JSON-like formats also often have to try to deal with the fact that JSON doesn't strictly define all semantics. Some of them differ from JSON is subtle ways, so supporting both JSON and sorta-JSON can lead to nasty side-effects.
Maybe most importantly, since we're not writing software that's speaking to web browsers, JSON isn't even particularly convenient to begin with. A lot of the software will be in C and Rust most likely. It helps a bit for scripting languages like Python, but I'm not convinced it's worth the downsides.
- otabdeveloper4 2y agoSorry, but bash isn't a "niche language" and it doesn't have an FFI story.
- jchw 2y agoI don't know how to tell you this, but, you don't need to implement an RPC protocol in bash, nor do you need FFI. You can use CLI tools like `dbus-send`. I pray to God nothing meaningful is actually doing what you are insinuating in any serious environment.
- otabdeveloper4 2y agoI'm trying to tell you that something that isn't straceable and greappable shouldn't belong in your system services stack.
- jchw 2y agoStrace/ptrace is awful, and I don't know what "greappable" means here. Nothing stops us from adding DTrace probes.
- eep_social 2y agoBehold, FFI for bash: https://github.com/taviso/ctypes.sh https://github.com/taviso/ctypes.sh
- ChoHag 2y agoFFI is the shell's only job.