3 ms·
So basically the author is saying: The UNIX shell pipeline is really just a functional programming language whose functions can only operate on strings. Think
by dsrguru 15y ago
So basically the author is saying:
The UNIX shell pipeline is really just a functional programming language whose functions can only operate on strings. Think how much more powerful, concise, readable, etc. it would be if other data types were supported.
I agree. I don't even think this requires changes at the OS level. Newlisp and Racket's shell attempt might be clunky, and Clojure certainly isn't ready for quick-and-dirty scripts, but it shouldn't be too hard to implement such a language if shell replacement is its main purpose.
- adobriyan 15y agoUnix pipes are about octet streams not strings.
- dsrguru 15y agoIn most hackers' idiolect, the term "string" refers to an implementation-dependent representation of characters. An octet stream or byte stream is the abstraction that UNIX files and the standard I/O streams happen to be instances of. So it wouldn't be wrong per se to use "octet stream" here, but I'm treating each phase of the pipeline as a hypothetical function that operates on text. With less indirection, you could certainly view them as functions operating on streams, but I abstracted that away in my mental picture.
- rbanffy 15y ago> Think how much more powerful, concise, readable, etc. it would be if other data types were supported. One of the reasons Unix is alive and well today is because of its simplicity. I'm not sure about the wisdom of introducing a system-wide type system. Let's see who's using Microsoft's PowerShell 40 years from nos.