News for hackers. Stuff that matters.
Re:The Dawn of a new Command Line Interface (2017) by jodrellblank on Tuesday April 13, 2021 @11:52AM (#26794057)
Why not simply make the pipe explicitly HTTP?

    first | second | third
"first" starts up a HTTP server, "second" is a HTTP client which makes a standard HTTP request to "first" declaring in the headers what content types it can support, and "first" returns a standard HTTP response declaring in the headers what kind of content it is sending. "Second" is also a HTTP server for "third" in the same way, and so on down the pipeline. All the OS has to do is coordinate a free TCP port for each pipe. The HTTP client can simply be a lightweight headless Chrome Electron bundle, and the whole pipeline gets all the benefits of HTTP (standard UTF-8 encoding, compression), with only a small overhead of cookie policies, cross pipe scripting, modern auth tokens, 2-factor authentication between client and server, SAML, and a tiny surface area increase for security concerns but only a few dozen MB or so.

Plus the pipeline then has ongoing two-way communication up and down it.

Re:The Dawn of a new Command Line Interface (2017) by MayeulC on Tuesday April 13, 2021 @04:06PM (#26798433)
The idea isn't that bad.

Obviously the following can't be taken at face value:

> lightweight headless Chrome Electron [...] with only a small overhead of cookie policies, cross pipe scripting, modern auth tokens, 2-factor authentication between client and server, SAML, and a tiny surface area increase for security concerns but only a few dozen MB or so.

However, there's probably much to be learned from the history of the web when it comes to security and compatibility between different implementations and successive evolutions of a protocol. http certainly has merits, given its long history. It isn't flawless either, of course.

Even features such as compression could make sense at first glance, though they would be a better fit for a dedicated tool like piping to zstd, since you control both ends of a pipe. Range requests, multiplexing, server-sent events, etc, could have some use. And it isn't like making a http server or client is so hard with a small library, given you already pull in libc or worse.

http probably wouldn't be suitable as-is, certainly not over TCP (though the fopen/fclose dance is quite close to it), but making it a fully fledged bidirectional protocol could be interesting, especially if you can somehow build on top of the system IPC on a microkernel. It could be a way to forward hardware access and such.

Re:The Dawn of a new Command Line Interface (2017) by _lffv on Tuesday April 13, 2021 @01:43PM (#26796153)
This is a dangerous joke to make / idea to perpetuate given the audience of HN.
Re:The Dawn of a new Command Line Interface (2017) by TeMPOraL on Tuesday April 13, 2021 @02:36PM (#26796956)
Agreed. I'm tempted to simultaneously upvote and flag this idea :).
Re:The Dawn of a new Command Line Interface (2017) by karatinversion on Tuesday April 13, 2021 @12:42PM (#26795089)
This is awful, I love it.