4 ms·
> Wouldn't it be nice to write shell scripts with objects and data structures? IMO no, it wouldn't. The simplicity and flexibility of plain text piping beats o
by eikenberry 5y ago
> Wouldn't it be nice to write shell scripts with objects and data structures?
IMO no, it wouldn't. The simplicity and flexibility of plain text piping beats out the more structured approaches. Sort of reminiscent of how HTTP ate the lunch of most all other RPC protocols (eg. CORBA) even though it wasn't even designed to be an RPC.
- bitwize 5y agoBut you only have the option of sending unstructured, untyped bytes over the pipe, which means you waste CPU cycles parsing and validating at each stage. And all data has a type, so you may as well have strong typing in your shell. HTTP ate everybody else's lunch mainly because corporate firewalls closed off competing protocols' ports but kept port 80 open.
- drran 5y agoMaybe you use a different kind of pipe. My pipes allow me to send binary, typed data, e.g. protobuf. For example: http://temk.github.io/protobuf-utils/ http://temk.github.io/protobuf-utils/ . Do you know a good set of command line utilities to work with binary typed data?
- bitwize 5y agoYou're still sending untyped streams of bytes through the pipes, which must be marshalled and unmarshalled at the endpoints. PowerShell, by contrast, operates directly on objects with strongly typed fields.
- drran 5y agoData are just bytes. You can serialize data into an encoding, or you can send a raw memory snippet. It's implementation detail. Binary data is not a problem for UNIX pipes. Perl has powerful pack/unpack methods to efficiently work with binary data. Do you have tools to use this feature? If not, who will write them? Who will define a standard format to use? Who will extend the standard format, when necessary?