PowerShell does a lot of this, doesn’t it? PowerShell abandons the concept of programs transferring data as text, and instead has them tranferring serialized .Net objects (with type annotations) back and forth. It doesn’t extend to the filesystem, but it’s entirely possible to write functions that enforce type guarantees on their input (i.e. requiring numbers, strings, or even more complicated data types, like JSON).
A good example is searching with regexps. In Unix, grep returns a bunch of strings (namely the lines which match the specified regex). In PowerShell, Select-String returns match objects, which have fields containing the file that matched, the line number that matched, the matching line itself, capture groups, etc. It’s a much richer way of passing data around than delimited text.
PowerShell does a lot of this, doesn’t it? PowerShell abandons the concept of programs transferring data as text, and instead has them tranferring serialized .Net objects (with type annotations) back and forth. It doesn’t extend to the filesystem, but it’s entirely possible to write functions that enforce type guarantees on their input (i.e. requiring numbers, strings, or even more complicated data types, like JSON).
A good example is searching with regexps. In Unix, grep returns a bunch of strings (namely the lines which match the specified regex). In PowerShell,
Select-String
returns match objects, which have fields containing the file that matched, the line number that matched, the matching line itself, capture groups, etc. It’s a much richer way of passing data around than delimited text.