• Otter@lemmy.caOP
      link
      fedilink
      English
      arrow-up
      27
      ·
      5 months ago

      I think it’s to make it easier to write bash scripts, for those who are new or when the script is doing a more critical task

      Modern Syntax

      You will find many of the language features familiar, allowing you to get up and running much faster than if you were learning Bash from scratch.

      Runtime Safety

      It’s one of the key components missing from regular shell scripts. It can help you catch many bugs at compile time.

      Type Safety

      Amber ensures that you handle everything that could fail. Each Bash command and function that could fail must be handled in some way.

      • VubDapple@lemmy.world
        link
        fedilink
        arrow-up
        11
        ·
        5 months ago

        Ok, I guess that makes sense. Bash is a pretty old school language for those raised in the functional programming era

        • vext01@lemmy.sdf.org
          link
          fedilink
          arrow-up
          30
          ·
          5 months ago

          Never heard of this language, but you’d be surprised how hard it is to write a correct and portable shell script.

          Personally, I’d break out python once the script gets larger than a few lines, or rust if I want something more proper.

      • towerful@programming.dev
        link
        fedilink
        arrow-up
        8
        ·
        5 months ago

        For me, after looking over the docs, it’s close enough to JavaScript that it might as well adopt more of the syntax (for example, conditionals and loops don’t use parenthesis). It also has some similarities to python, but again not enough to be python.

        Feels like an in-between language that has enough similarities to seem easy, but some gotchas that will regularly catch you out.
        And then some extra features like the if chaining, which doesn’t have the keyword if or switch in it. So you have to know that that structure implies an if or switch conditional.

        Especially for something like bash scripting, which devs probably don’t spend as much time doing compared to python or js. So, it would probably take them longer (and break their brain more) than just scripting it in python/js directly or dealing with bash directly.

        It’s an improvement over bash, and it’s nice that it transpiles to bash.
        I might have to play around with it and see how it actually feels to use

        • DeprecatedCompatV2@programming.dev
          link
          fedilink
          arrow-up
          3
          ·
          edit-2
          5 months ago

          I found the if-blocks more concerning than the lack of parentheses. Although I would’ve preferred parentheses for better parity with Kotlin for the if-else blocks (instead of then).

  • aluminium@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    5 months ago

    I mean if you want a shell language that behaves more like a regular programming language, PowerShell core is a thing.