Hi DevOps, how do you think your ideal programming language would look like? I mean a language in which you would write pipeline logic, like Python or Bash, not define pipeline steps itself, like YAML.

I think for me it would have:

  • very clean and readable syntax
  • immutable state by default
  • strong typing
  • strong tooling and IDE support
  • focus on DevOps-need things, like JSON and files manipulation
  • absence of danger things like pointers
  • Corbin@programming.dev
    link
    fedilink
    English
    arrow-up
    4
    ·
    2 days ago

    Nix comes closest. The biggest issue with Nix is that it does not admit a clean simple LL/LR grammar, but I think it admits a PEG, which is fine for practical work. The ecosystem could use more independent implementations and tooling, but I haven’t found any deficiencies with the language that would make me prefer e.g. Guile Scheme’s larger standard library and richer types.

    HCL is another option. It’s not awful, but it’s verbose when trying to do anything higher-order, and it wasn’t intended to directly represent lambda-style subroutines. Guile Scheme, as used in Guix, is clearly capable, but requires embedding a fairly large standard library or having to NIH common routines; similar problems plague Lua or Python.

    I think that your question has an interesting framing. My first answer was to mention jq and the relational pipes toolkit, but those are still run from a top-level shell. For example, I suppose that there’s two things that you can do with JSON: you can manipulate it and I would use jq for that, or you can load it as a datastructure into a (build) action and I would use Nix for that. jq is close to ideal for its particular formalization, but relational pipes are still evolving and I think that there are further simplifications that could be made.