Proposal: JSON-RPC over stdin/stdout for subprocess integration #3484
frankhsueh
started this conversation in
Extensions and tool development
Replies: 1 comment
|
Hi @frankhsueh! This is an interesting proposal. Do you have a concrete use case that needs this? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Proposal: JSON-RPC over stdin/stdout for subprocess integration
I'd like to propose adding a stdio transport for Apalache's JSON-RPC API.
The intended use case is applications that embed Apalache as a local child process rather than operate it as an independently managed network service.
Today, such an application needs to:
For a child-process integration, this adds complexity without providing much benefit from the network transport.
Proposed interface
For example:
or:
The process would use:
The RPC methods and semantics would remain the same as the existing JSON-RPC server; only the transport would change.
Conceptually:
Motivation
This would make Apalache substantially easier to embed in tools that want a private verifier process.
Advantages include:
The existing network transports would remain useful for independently managed, shared, or remote Apalache servers. Stdio would be complementary, optimized for the local subprocess case.
Framing
The simplest framing would be newline-delimited JSON (NDJSON):
Alternatively, a length-prefixed framing such as LSP's
Content-Lengthscheme could avoid relying on newline-delimited messages.This proposal does not require introducing a new RPC API. It reuses the existing JSON-RPC API and adds stdio as another transport.
All reactions