It's weird how even pure languages tend to treat the Unix execution model as ambient state.
Are there any PLs that define a main function like this?
fn main(args, stdin, stdout, env) -> exit code
miniblog.
Related Posts
I frequently find myself running:
$ slowish
$ slowish | jq
$ slowish | jq | grep
I feel there must be a better way to build up pipelines incrementally without re-running.
I could save each output to a file, but it's more verbose, and most of these tools have nicer output when stdout is a TTY.
One interesting property of both stdin/stdout based REPLs and RPC based REPLs is that they need to support asynchronous events.
In both these programs, I don't need to wait until the function is done to see the output printed. It's not sufficient to read-eval-wait-print-loop.
Rich Hickey compares REPL design with RPC style nREPL: https://groups.google.com/g/clojure-dev/c/Dl3Stw5iRVA/m/IHoVWiJz5UIJ
Rich considers the nesting ability to be important. If the user is interacting with stdout/stdin, they can enter arbitrary other text UIs.

