4 ms·
During a recent HN discussion on pipes and text versus structured objects to transfer data between programs, I started wondering if CSV wouldn't be a nice middl
by gpvos 4y ago
During a recent HN discussion on pipes and text versus structured objects to transfer data between programs, I started wondering if CSV wouldn't be a nice middle ground.
- carlmr 4y agoI still think objects are great, but PowerShell makes it so hard to deal with them. I think F#-interactive (FSI) with its Hindley-Milner type-inference, would have been a much better base for a shell.
- gpvos 4y agoI'm not familiar with F#, but I do hate CSV tools that try type inference on data; in my opinion the csvkit tools should have the -I option on by default.
- carlmr 4y agoF# does type inference like this: let x = 1; x is now an integer. Now you can't do printfn "%s" x; Only printfn "%i" x; So it has strong static typing, but most of the time you don't need to be explicit about them. It can even infer function types. If you use FSI (F# interactive( it will always print the signatures in between, so that it's really easy to explore interfaces.
- majkinetor 4y ago> I still think objects are great, but PowerShell makes it so hard to deal with them. LOL, this is amazing...
- carlmr 4y agoThe thing is, I've used .NET a lot, and C# and F# I can code in my sleep. The same object system, integrated in PowerShell, makes it really hard to use.
- majkinetor 4y agoThat is even more amazing. What makes it "so hard". $object.Proprety or $object.Method() is the same. new versus new-object? [type] vs type ?
- jerf 4y agoJSON Lines would probably beat that out: https://jsonlines.org/ https://jsonlines.org/ I phrase that carefully. "Better"? "Worse"? Very subjective. But in the current environment, "likely to beat out CSV"? Oh, most definitely yes. A solid upside is a single encoding story for JSON. CSV is a mess and can't be un-messed now. Size bloat from endless repetition of the object keys is a significant disadvantage, though.