-
NoT Notation for Parameters in Next Generation Shell
“NoT” (Name or Type) notation for parameters of functions in Next Generation Shell’s documentation.
-
Exceptional Processism
Exceptional processism in programming is treating your own process more favorably with regard to exceptions. Errors that happen in your own process throw exceptions while errors that happen in processes that you are running are not mapped into exceptions in your own process. This breaks the uniformity of error handling in the language: Languages with…
-
Teaching old assert() new Tricks
Many languages have assert(). This post describes how assert() is implemented in Next Generation Shell and how these aspects/features are consistent with the rest of the language. Implied in the above is that the ideas below might not be a good fit for assert() in your favorite language or framework. Note that assert(EXPR, PATTERN) in…
-
Predicates, Upgraded
This post describes the thought process and implementation of moving from predicates to patterns while keeping this feature consistent with the rest of the language and compatible with existing code. Minimalistic example: Background While implementing the language, I’ve added higher order functions that seemed “obvious” to have in a language: Observation What I’ve noticed after…
-
“if grep”, the bomb
Take 2 This is version two of the post, based on the feedback in this Reddit discussion. Some things need clarification. That includes the title which should be something like Why NGS has more ergonomic error handling than bash Background I was using bash and Python for “DevOps” scripting. Frustrated by both, I’ve started working…
-
The Journey to retry_assert()
I was annoyed quite a bit with bash (no, not because I was new, I used it professionally daily for 12 years before starting NGS). One of the red herrings was the constant need to reimplement small stupid things like retry() function for example (or copy it all the time across projects and adjust as…
-
UI in NGS
Before describing UI design in Next Generation Shell, let’s clarify which problems we are trying to solve. Problems Warming exercise: CLI is an interface that focuses on a single line, the Command Line. Stop for a moment to ponder that. Unusable Output and Missing Semantics Treating the output of a program as if it was…
-
main() in NGS
Background oilshell, added in-main builtin recently, allowing the following: OSH: YSH: Source: https://www.oilshell.org/blog/2023/09/release-0.18.0.html I commented about why not have main() that is invoked manually. That’s exactly what NGS does after all. There was a request for clarification and I decided to post it here. Python I’ll start with Python because frustration with Python and bash…
-
AWS CLI with NGS instead of jq
I’ve been using jq to process the output of AWS CLI for years. I suspect many others are doing the same. Let’s take a closer look at jq and its alternatives. jq The Good Why jq is so good? Because it’s domain specific; think sed, grep, and awk mixed together and not for text but…
-
The Unix Shell’s Humble If – Fixed
I’ve seen this post – https://thoughtbot.com/blog/the-unix-shells-humble-if and there was no place for comments. Here is my humorous response then. ( Below: removed added ) The Unix shell is often overlooked by software developers (many times for good reasons) more familiar with higher level (read normal / saner / better / actually designed and not accidental)…