New favorite tool 😍

  • zygo_histo_morpheus@programming.dev
    link
    fedilink
    arrow-up
    9
    ·
    6 months ago

    Looking at the example

    Why does the generated bash look like that? Is this more safe somehow than a more straighforward bash if or does it just generate needlessly complicated bash?

  • bss03@infosec.pub
    link
    fedilink
    arrow-up
    3
    ·
    6 months ago

    Late to the party. Idris had a bash backend (i.e. you could compile Idris to bash), and it’s already bit rotted with new Idris versions.

    I hope the language is at least as cool as Idris.

  • popcar2@programming.dev
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    6 months ago

    Compiling to bash seems awesome, but on the other hand I don’t think anyone other than the person who wrote it in amber will run a bash file that looks like machine-generated gibberish on their machine.

    • jack@monero.town
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      6 months ago

      There is no sh shell. /bin/sh is just a symlink to bash or dash or zsh etc.

      But yes, the question is valid why it compiles specifically to bash and not something posix-compliant

  • ReluctantMuskrat@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    6 months ago

    As a long-time bash, awk and sed scripter who knows he’ll probably get downvoted into oblivion for this my recommendation: learn PowerShell

    It’s open-source and completely cross-platform - I use it on Macs, Linux and Windows machines - and you don’t know what you’re missing until you try a fully objected-oriented scripting language and shell. No more parsing text, built-in support for scalars, arrays, hash maps/associative arrays, and more complex types like version numbers, IP addresses, synchronized dictionaries and basically anything available in .Net. Read and write csv, json and xml natively and simply. Built-in support for regular expressions throughout, web service calls, remote script execution, and parallel and asynchronous jobs and lots and lots of libraries for all kinds of things.

    Seriously, I know its popular and often-deserved to hate on Microsoft but PowerShell is a kick-ass, cross-platform, open-source, modern shell done right, even if it does have a dumb name imo. Once you start learning it you won’t want to go back to any other.

    • caseyweederman@lemmy.ca
      link
      fedilink
      arrow-up
      1
      ·
      6 months ago

      I appreciate you sharing your perspective. Mine runs counter to it.
      The more PowerShell I learn, the more I dislike it.

      • ReluctantMuskrat@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        5 months ago

        I do. Currently I use it mostly for personal stuff as part of my time spent on production support. Importing data from queries, exporting spreadsheets, reading complex json data and extracting needed info, etc. In the past when I was on DevOps used it with Jenkins and various automation processes, and I’ve used it as a developer to create test environments and test data.