Category: Programming Language
-
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…
-
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 Case for Semantics in the Shell
Should the shell have semantic understanding of external programs that it runs? By “semantic” I mean here specifically “understanding” of inputs and outputs to the level which allows something smarter than bytes and text manipulation. My claim is that semantic understanding by the shell is necessary in order to be productive. Let’s delve into the…
-
Filling The Matrix (Language Design)
Filling the matrix is a language design principle. I’ve coined the term because I am not aware of a proper term describing the principle below. Let me know if you are aware of a proper existing term; I assume I’m not the first thinking about this. Background Next Generation Shell, a shell I’m working on,…