About Next Generation Shell

Next Generation Shell is a shell based on belief that shells should adapt to what happened in the decades since “classical” shells appeared:

  • Structured data and talking to APIs are now at the core of what DevOps do. Yes, jq is nice but data structures should be in the language.
  • Programming has advanced. Ideas such as ignoring errors or undefined variables by default would be laughed out of the window today. We don’t have to tolerate this just because it’s there.
  • UI/UX advancements

Let’s also note that “but bash is everywhere” approach will not lead us forward. Ever.

What Sets NGS Apart?

Compared to other shells, NGS chose:

  • Fully fledged programming language with domain specific facilities
  • Full screen interaction

Details follow in the next two sections.

Programming Language

NGS has fully fledged (one could say “normal”) programming language with domain specific facilities. Other shells typically employ domain specific languages.

Main concepts: multiple dispatch, types (including user defined), data structures.

Sample domain specific facilities:

  • Running external programs: convenient syntax, parsing output, handling of exit codes.
  • Integration as a script: automatic command line arguments parsing, easy to implement nested commands (ex: ./my_scritpt hosts list).
  • Convenient small scale data manipulation.
  • Standard library instead of re-implementing for the thousandth time on top of your scripts: log(), retry(), assert().

This sample code waits for given AWS CloudFormation export to appear:

#!/usr/bin/env ngs

F main(export_name:Str, times:Int=360, sleep:Int=10) {
  log("Waiting for export ${export_name}")
  retry(times=times, sleep=sleep, body={
    ``aws cloudformation list-exports``.any({"Name": export_name})
  }, progress_cb=F(n, out_of) {
    log("Attempt ${n} out of ${out_of}")
  })
  log("Export ${export_name} was found")
}

User Interface

NGS believes in full screen interaction based on semantic understanding of outputs of programs. Other shells typically focus on single line interaction, the command line of the CLI.

NGS considers the CLI communication paradigm, outdated and ineffective. Yes, in most cases, it is more effective than your typical web UI or an application. It doesn’t mean we can’t do better interfaces. We should at least try and not be content with the send-text-receive-text telegraph-like communication paradigm from the 19th century.

UI in NGS is work in progress.

Use Cases

These pesky small CI/CD or other automation scripts in bash, Python, Ruby, Perl, Node.js? If you are a “DevOps” and these scripts are a big part of what you do daily, stop that and do NGS instead. Suffer less. See NGS Uses Cases on GitHub wiki.

When UI is ready, I’ll update here. Your interactive work will never be the same. Tune in.

Links

GitHub – https://github.com/ngs-lang/ngs

Website – https://ngs-lang.org/

Discord – https://discord.gg/6VqgcpM

Sample scripts – https://github.com/ngs-lang/ngs/tree/7e1d43ba5169c6962aceb1fcbb73c12b2f8d3137/bin

Author

Ilya Sher started developing NGS at 2013, discontent with bash and Python for DevOps.

Ilya is doing programming and (what today called) DevOps professionally since 2001.