Skip to content

Coprocess Protocol Proposal

andychu edited this page Nov 21, 2018 · 28 revisions

Abstract

This is a sketch of protocol to allow coprocesses to substitute for normal "batch" processes in shell scripts. A coprocess can be thought of as a single-threaded server that reads requests from a pipe and writes responses to a pipe.

The goal is to make shell scripts faster. It can also make interactive completion faster, since completion scripts often invoke (multiple) external tools.

Motivation / Analogy

Why Coprocesses and not Multi-threaded Servers?

Because it will be easier for existing command line tools to implement this protocol. Many tools are written with global variables, or they are written in languages that don't freely thread anyway (Python, R, etc.).

Related

Shellac Protocol Proposal -- this protocol for shell-independent command completion can build on top of the coprocess protocol.

Clone this wiki locally