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.

  • CameronDev@programming.dev
    link
    fedilink
    arrow-up
    18
    ·
    9 hours ago

    If your comfortable writing rust, why not just use rust and compile to rust binaries? Rust has toolchains for realistically everything…

    • Quibblekrust@thelemmy.club
      link
      fedilink
      English
      arrow-up
      10
      ·
      8 hours ago

      It’s not Rust, OP was mistaken. It’s ECMA-Script-like with Rust-like features and also Python-like features.

      I think the idea is, you can develop Amber scripts “at home” then deploy them on any machine that has Bash without needing to install anything. This benefits system admins.

      Amber compiles directly to shell code, so you can:

      • Leverage existing shell tooling and pipelines.
      • Deploy a single script without installing a language interpreter.
      • Benefit from shell‑native features (process substitution, job control) while enjoying high‑level syntax and safety.

      Is Amber production‑ready?

      In the the project it is production ready because it is already used in this context because the shell code generated is tested and confirmed that works, the language is evolving with the tooling set.

      Well, their FAQ isn’t exactly production ready.

      • False@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        6 hours ago

        Eh, go is really good for this kind of stuff. It compiles to a single binary you can just execute from shell