Hello, I’ve written a tool helping me keeping my histfiles free of my secrets. I’d like to hear your thoughts and suggestions about it. I’m a Haskell noob, so please be kind. https://github.com/bionade24/histcleaner

  • bionade24@kbin.socialOP
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Thx a lot for your detailed feedback. I already heard about bang notation once, but forgot about it. I think I do understand how laziness works, but I can’t understand why it’d be bad if Vault gets loaded into memory the 1st time it’s needed. Does GHC split the parsing into multiple operations because salt is used a little earlier than secrets?

    • jaror@kbin.social
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      It’s not that the vault only gets loaded into memory the 1st time it is needed, what will happen is that the secrets will be read into memory in their raw form and only decoded on-demand. So if you only access the first secret, then it will only decode the first secret and not the rest. Haskell’s laziness is very granular like that. In this case it indeed is not that big of a deal, because it probably won’t use a lot more memory, but I’d still consider it a code smell.