The gist—as I understand it—is that Unix programs are essentially all equivalent to functions : ([String], TextStream) -> (TextStream, TextStream) which limits how one can tie them together and causes a proliferation of text-processing tools (awk, sed, grep, cut, &c &c) which is not as elegant as functional programming. There are already some Unix command-line tools that work on structured data as mentioned, e.g. jsa…
Just because data is in a text stream doesn't mean it is not structured. Awk is designed to handle structured text for example, the output of most (traditional) Unix tools is 'structured' too (eg., ls and ps). I recommend you read The Unix Programming Environment which gives many illustrations of how the Unix 'text streams' model works in practice. One of the authors of that book and other folks that created Inferno…
Functional programming and the death of the Unix Way
31–34 of 34 posts
Re: Functional programming and the death of the Unix Way
#32So 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-an…
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.
Re: Functional programming and the death of the Unix Way
#33Re: Functional programming and the death of the Unix Way
#34I had an idea to write Clojure parsers for the standard unix command line tools that translates the output into s-expressions. I got too frustrated - on the one hand, Clojure's slow start up time meant it was no fun to use in a simple pipe and on the other hand, even the simplist unix util has surprisingly complicated behavior. Like `wc` - it outputs three columns of numbers, right? Well, unless it knows filenames, w…
Not all functional languages run on the JVM or anything similar. In fact, most don't. See: Haskell, *ML, most Lisps and Schemes, ...
Compare to perl, where piping text is so simple that chaining perl scripts with pipes is no harder than writing functions.