4 ms·
No "proper programming language" is capable of ergonomically piping between programs. Shell is indeed very old and it's time for a replacement, but it's not th
by Kinrany 5y ago
No "proper programming language" is capable of ergonomically piping between programs.
Shell is indeed very old and it's time for a replacement, but it's not there yet.
Oilshell might get there eventually or at least spark interest in this area.
- ilyash 5y ago> No "proper programming language" is capable of ergonomically piping between programs. Solved. https://github.com/ngs-lang/ngs https://github.com/ngs-lang/ngs I'm the author. Frustrated with exactly this situation I created Next Generation Shell. It's a "proper programming language" on one hand but domain-specific for "DevOps"y scripting on another. So sane syntax, data structures, error handling, multiple dispatch on one hand but also syntax for running external programs, pipes and redirects. You are welcome!
- ccalloway 5y ago> No "proper programming language" is capable of ergonomically piping between programs. You cherry-picked the one thing that shell script is somewhat better at than other languages (not even really needed for this task). Meanwhile the article uses shell for both making HTTP requests and mangling JSON data, both of which are easy in all modern languages, and extremely painful in shell.
- actually_a_dog 5y agoIt's not cherry picking to mention the thing that makes a fundamental component of the UNIX philosophy work. > (ii) Expect the output of every program to become the input to another, as yet unknown, program. Don't clutter output with extraneous information. Avoid stringently columnar or binary input formats. Don't insist on interactive input. https://homepage.cs.uri.edu/~thenry/resources/unix_art/ch01s06.html https://homepage.cs.uri.edu/~thenry/resources/unix_art/ch01s...
- ccalloway 5y agoOK, the Unix philosophy holds that this is one of the most important things, and therefore it's easy to do in shell. But what if it's not? It's perfectly easy to write code to do the same thing in a programming language without invoking any other executables, let alone piping the output of one into the input of another. So the claim that this functionality is what makes Unix and shell scripting effective is vacuous. They are good at doing something which would not be necessary if one was not using them.
- Kinrany 5y agoBeing able to compose programs is not a necessity, but it saves effort. A single pipe replaces M*N different programs with M+N different programs. This is how Unix won.
- deleted 5y ago[deleted]
- unixbane 5y ago*sh is only ergonomic if you're using it insecurely. wait, even then it's not ergonomic. you're just insane. the day i figured out about python repl over 10 years ago, i realized *sh is utterly obsolete (and python isn't even good, a repl like that just gives you some perspective of how things could be).