Modernish: a shell moderniser library
github.com
Modernish: a shell moderniser library
1–10 of 16 posts
Re: Modernish: a shell moderniser library
#2Your reasoning and explanations are first rate, and the documentation is superb.
Your emphasis on POSIX is a great approach for working on a very wide variety of shells, including older ones and regulated ones. I deal with these regularly at enterprise clients, and I'm excited to try Modernish with these. Kudos!
Re: Modernish: a shell moderniser library
#3Re: Modernish: a shell moderniser library
#4Isn’t this going to make shell scripts that were already fragile on anything but bash not only fragile but also harder to debug? Combining the engineering ideas of JavaScript and autoconf with the checkered history of shell scripts seems like a case of -1 + -1 = -5.
Re: Modernish: a shell moderniser library
#5Re: Modernish: a shell moderniser library
#6Re: Modernish: a shell moderniser library
#7Javascript and Shell programs are actually pretty similar IMO. Both are loosely functional languages that can run in many different environments, with different feature sets in each. Both run from a single entry point. A lot of JS tooling could be applied to Shell scripting.
This library takes the right approach, by augmenting existing functionality with syntactical sugar for safer programming. The wrong approach is the many libraries attempting to make a “new” shell language, or a “superset” of shell. The beauty of shell programming is its portability, but that’s lost once you have even a single feature relying on non-POSIX functionality.
I like the Modernish approach because it’s just a library, but writing it can feel like writing a cleaner version of shell. The docs say Modernish was inspired by jquery, but I would argue it’s more akin to underscore or lodash in this sense.
Following the trend of shell/JS similarities, what I would like to see is a compiler and packaging system similar to webpack and npm. I’m not talking about a package manager that downloads libraries and binaries into some directory in $PATH, but rather a bundler that compiles all libraries imported from an entrypoint into a single executable shell script.
Re: Modernish: a shell moderniser library
#8This is amazing for shells. Thank you for writing it. Your reasoning and explanations are first rate, and the documentation is superb. Your emphasis on POSIX is a great approach for working on a very wide variety of shells, including older ones and regulated ones. I deal with these regularly at enterprise clients, and I'm excited to try Modernish with these. Kudos!
His email ID, according to a personal web page of his [2], is martijn at_the_rate_of inlv dot demon dot nl , in case you wish to send the kudos along his way.
Re: Modernish: a shell moderniser library
#9Note "use safe" in the README is missing some words:
> "Does IFS=''; set -f -u -C, that is: field splitting and globbing are disabled, variables must be defined before use, and"