Hacker News new | ask | show | jobs
by hussainbilal 1515 days ago
Why use types? Why not introduce built in parsers to provide validations instead? (i.e. https://github.com/antlr/grammars-v4)

I think hush is going in the wrong direction. The majority of shell automation is associated with running IaC and container images / orchestration tools.

Shell scripts don't need to follow functional programming or OOP. They need to be container-oriented / VM-oriented / image-oriented with a conformation to YAML notation as this is already the adopted norm for containers and IaC.

1 comments

Side note: The most straightforward way to incoporate YAML as an elevated text "type" would be to define a new type of pipeable file descriptor on all commands, specifically meant for replacing shell script options / flags. (That way options aren't mixed with stdin)

Edit: and you get typing validation for free by running your yaml options through a yaml schema validator should you choose to do so