That was so cool. Kind of an eye-opener. Bookmarked, thank you!
Re:Shell Scripting with Elixir
by adityaathalye on Tuesday February 13, 2024 @12:20PM
(#39360068)
Thank you for the kind remark. It so happened that I picked up shell scripting on the job at a workplace full of FP nerds. Pipelined code felt eerily familiar. Then at some point I read that Archmage McIlroy, a mathematician by training, invented the pipe. That was a lightbulb moment; a big reason why Functional style works as well as it does. Pipes are a mathematical idea.
That whole series of posts is basically a glorified bookmark for yours truly. Tactics and tricks accumulated over the years. I refer back to bits and bobs from time to time. Writing them was a lot of, ah, fn.
Re:Shell Scripting with Elixir
by giovannibonetti on Tuesday February 13, 2024 @08:48AM
(#39357552)
This Bash library [1] is very handy to make your scripts more functional.
Re:Shell Scripting with Elixir
by adityaathalye on Tuesday February 13, 2024 @12:31PM
(#39360196)
I feel like I've seen this one before. Thanks for bubbling it back up in my brain.
I think `map`, `filter`, and `reduce` (or `accumulate`) are automatic in pipelines; and have usually been enough for me. Still, it has a bunch of stuff one can pinch in a hurry. Starred!
Of course, one can take a Shell script only so far. Eventually a Real Programming Language is the inescapable (pun intended) conclusion. [Insert "Always was" meme].
[1] I wrote about it here.
https://www.evalapply.org/posts/shell-aint-a-bad-place-to-fp...