3 ms·
What if there was a standard way to describe inputs, outputs and side effects of programs? Think of it like writing/downloading type definitions for existing u
by vbsteven 5y ago
What if there was a standard way to describe inputs, outputs and side effects of programs?
Think of it like writing/downloading type definitions for existing untyped code. With program descriptions like this shells could become smarter, generate warnings, abort before execution if types don’t match up, etc.
- toomanyducks 5y agoI think I like the theory of this but in practicality I'm pretty sure I'd just get irritated by it. In most usage, there is only one input and output format, being plain text. If I specify a given type further and send it to grep/awk/sed/cut, I'd need to explicitly or implicitly coerce the given output to plain text, at which point I'd either lose the original type information or require some unholy transformations to retrieve the original type. I think this misses how I use the shell: sending plain text information to and from files and executables. The whole point is that there is no type system and everything is just plain text. For something smarter that behaves more like a typed programming language, there's Perl, Python, etc.