News for hackers. Stuff that matters.
Re:“It's The Future” by mpeg on Wednesday August 17, 2016 @09:05AM (#12304334)
bar(foo)

When you're not writing shell, just use the tools the language gives you.

For the matter, I think a shell script is cleaner than a python script for devops; but I don't think the composability of unix tools is that much of an advantage compared to the amount of python libraries out there.

Re:“It's The Future” by mbrock on Wednesday August 17, 2016 @09:12AM (#12304381)
When I use shell it's often exactly because I want to construct pipelines of processes and FIFOs and do all the other things that shell does very well and has done well for decades.

I'm likely to be using Python programs and other programs in those shell scripts. The beauty of shell is that it makes it so easy to compose programs written in different languages.

Re:“It's The Future” by lmm on Wednesday August 17, 2016 @10:34AM (#12304994)
Shell does things well provided all the intermediate states are naturally expressible as streams of bytes. Otherwise not so much.

I think the advantages of using a single language for everything outweigh the disadvantages - see e.g. http://www.teamten.com/lawrence/writings/java-for-everything... (though actually my single language is Scala)

Re:“It's The Future” by mbrock on Wednesday August 17, 2016 @11:17AM (#12305319)
Everything in a computer is a stream of bytes... My shell scripts often use tools like jq and jshon to deal with JSON structures, etc. File hierarchies can also be very pleasant data structures.

The kinds of scripts I write would be awkward to have as compiled JVM programs, I think. Shell is just way more ergonomic for me for many tasks.

Re:“It's The Future” by lmm on Wednesday August 17, 2016 @11:44AM (#12305532)
> Everything in a computer is a stream of bytes

Data can be meaningfully separated from control and structure in many cases, and failure to do that is a major (perhaps the major) source of security bugs.

Re:“It's The Future” by Retra on Wednesday August 17, 2016 @08:39PM (#12309656)
Everything in a computer can be interpreted as a stream of bytes. For most things an object is a better interpretation.
Re:“It's The Future” by mbrock on Thursday August 18, 2016 @07:16AM (#12311589)
You could then also criticize for example HTTP or even TCP for making you turn everything into "bytes".

Shell doesn't enforce any particular interpretation of data. Pipelines simply connect one program's output to another's input. Interpretation is up to the programs.

Re:“It's The Future” by aninhumer on Thursday August 18, 2016 @09:07AM (#12312175)
>You could then also criticize for example HTTP or even TCP for making you turn everything into "bytes".

If these were the only standard protocols that existed, and people were trying to tell me this was great because it's easy to compose different network applications, that criticism would be completely valid.

>Interpretation is up to the programs.

But because there are no standards beyond "stream of bytes", the chance that two independently written programs working with non-stream-like data can communicate directly is extremely low.

Re:“It's The Future” by mbrock on Thursday August 18, 2016 @10:25AM (#12312687)
Lots of programs can communicate with JSON, XML, standard formats like that. If some legacy program outputs a non-standardized kind of output, that's a problem to be solved, not an inherent failure of shell scripting. There is no overarching successful solution to the problem of different programs using different data representations, but I don't blame this on shell; I work happily with shell scripts as do many many others. The same problem shows up the minute you want to use a Ruby module from Python, and rewriting everything in every language is not an economically viable solution.
Re:“It's The Future” by lmm on Thursday August 18, 2016 @11:07AM (#12313025)
> Lots of programs can communicate with JSON, XML, standard formats like that. If some legacy program outputs a non-standardized kind of output, that's a problem to be solved, not an inherent failure of shell scripting.

But the shell language itself is one of these legacy non-standardized formats. Arcane escaping rules, multiple incompatible implementations, surprising ways things get interpreted as code (e.g. the recent bash CGI bug),...