In short, Amber is a programming language with Rust like syntax that compiles down to bash. More details here: https://amber-lang.com/

On the surface, it seems nice. Cleaner syntax, types, compile-time safety checks, etc. So you get to write in something nicer than bash but get the portability of bash.

My wonder is if there are pitfalls that make it worse than instead writing it in something like Python or even bash itself. I’d guess the generated bash code probably isn’t the prettiest to look at or debug.

  • IrritableOcelot@beehaw.org
    link
    fedilink
    arrow-up
    2
    ·
    5 hours ago

    If you just want portability, then this could be useful. However, in my opinion a large part of why I use a shell script is to avoid compilation and just hack something together. If your goal is shell scripts that are easier to write you could also check out other shells:

    • fish is the easiest to use in my opinion, but is not POSIX compliant so you do have to learn the syntax.
    • zsh is a nice quality-of-life upgrade over BASH, tweaking the little things
    • There are also things like xonsh which use Python syntax for shell scripting, but I dont have personal experience with them.