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.

  • balsoft@lemmy.ml
    link
    fedilink
    arrow-up
    26
    ·
    8 days ago

    At the risk of stating the obvious, I would like everyone to know that https://www.shellcheck.net/ exists. Unless you are a bash wizard: if your bash script doesn’t pass shellcheck, it is very likely to have bugs.

    • tasankovasara@sopuli.xyz
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      Let’s also remind that at least Helix the very good editor automatically runs bash stuff through Shellcheck if you have it installed, while you type. It’s been amazingly useful and educational. I write a lot of bash at work and have learned many finer details from Shellcheck’s hints.

      It even does the Clippy thing. I’m piping something into a sed s/…/… and it tips ‘try ${variable//search/replace} instead’.