News for hackers. Stuff that matters.
Re:Alternative shell with native support for JSON, YAML, TOM... by linkdd on Saturday February 27, 2021 @10:02AM (#26285248)
> The difference is the syntax is structured more like Java's `try` and `catch` blocks

Which is a big plus, but the most interesting part to me is the "if" behavior you implemented.

  !if { foobar } then { ... }
Which basically translate to Bash (without STDOUT/STDERR handling):

   foobar
   if [ $? -ne 0 ] then ... fi
This is like 99% of my use cases when I'm writing scripts...

> As for testing, [...] they explain the syntax but not how nor why you might want to use it.

When I saw the examples, I immediately thought of "validation scripts" that would assert that an environment respects some specification (like the configure script from autotools ?)

> but man this post is already lengthy hehe

I enjoyed the details :)

Re:Alternative shell with native support for JSON, YAML, TOM... by hhvn on Saturday February 27, 2021 @10:52AM (#26285589)
This works the same as your example in bash.

foobar || { echo fail; }