News for hackers. Stuff that matters.
Re:Write Posix Shell by loevborg on Saturday March 11, 2023 @12:31PM (#35110536)
Shell scripting's best kept secret is babashka (https://babashka.org/).

- It's a flavor of Lisp (Clojure, specifically), a language whose flexibility makes it ideally suited for gluing together programs and working with data

- Compare to alternative scripting shells, babashka is very pragmatic and 100% production ready today, as it's built on top of Java, GraalVM and Clojure

- Even though it's Java under the hood, it's FAST (`time bb -e '(+ 1 1)' -> 0.014 ms)

- Support for filesystem operations (e.g. globbing) is as good or better than Bash

- Working with subprocesses is better than in bash, because there are fewer gotchas

- Piping is easier in bash, but most of the time you _don't_ really want to use pipes. `cat /etc/fstab | grep /usr` should be a set of function calls, not subprocesses

Give it a try, you won't regret it

There are no comments on this comment yet.