6 ms·
> (3) makes you programming with a dynamic, completely untyped language which forces each function to accept and return a single parameter that's just a string
by astrange 10y ago
> (3) makes you programming with a dynamic, completely untyped language which forces each function to accept and return a single parameter that's just a string blob. No other data structures allowed.
I think this is great. There's slightly more principled ways to do it, but having to convert everything to one single format at the end of the day keeps you humble.
Let's go back to the previous decade's Hacker News:
http://wiki.c2.com/?AlternateHardAndSoftLayers http://wiki.c2.com/?AlternateHardAndSoftLayers
- TeMPOraL 10y agoIt's not converting to "one single format", it's converting to "any and all possible formats", because with unstructured text, you're literally throwing away the structure and semantics inherent in the data, instead relying on users to glue things together with ad-hoc parsers.
- jstimpfle 10y agoPlease stop spreading bs. It's not throwing away structure. Piping text doesn't even preclude sexps. It's just that they are seldom needed. Simpler encodings like space-separated are sufficient for many use cases, and better for interoperation. It's misguided and inefficient to encode everything in the same way. Would you prefer to have your JPG or MP4 encoded in sexps? And I say that as someone who is working on a serialization format for relational databases.
- TeMPOraL 10y agoPiping isn't the culprit. It's what you pipe that is, and Unix Philosophy says "pipe whatever the hell you want, and let the users upstream sort it out". It's not about encoding everything in exactly the same way. It's about providing the basic, shared protocol for representing structure. With typical Unix tools, you don't have "simpler encodings", you have no encoding at all. Each tool outputs whatever its particular author felt like (and this changes between Unix systems), each tool parses things in whatever way its author felt like, and as a user your job is to keep transforming unstructured blobs of text to glue them together.
- jstimpfle 10y agoThere exists a shared protocol. It's called "explain it". But that's typically not even needed, the user can just look at the data and figure it out. > With typical Unix tools, you don't have "simpler encodings", you have no encoding at all. You don't even believe this yourself, do you? That's so obviously wrong. Name a well-thought out text file format that can't correctly be parsed e.g. by a Python one-liner with basic string operations. And please don't include: JSON, XML, YAML, sexps, because it's not possible, at least not without a library. Not needing special infrastructure is why these formats (often) win. Very obvious practical reasons. If you have applications where you need one of the above - go ahead and do it. Instead of trolling with this abstract, vague nonsense, it is better to propose a concrete case where existing practice is bad. Show how it should be done better. (And prepare to get contradicted).
- JoeAltmaier 10y agoI call "No True Scotsman"
- jstimpfle 10y agoI don't understand (sorry). Could you explain?
- JoeAltmaier 10y ago"All things like A are in category X. Except this long list I wrote, but they aren't really A, because I need my syllogism to work."
- jstimpfle 10y agoYou missed my cynism. I was opposed to these formats in the first place.
- JoeAltmaier 10y ago
- dang 10y ago> Please stop spreading bs. This breaks the HN guidelines: https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html. Please edit out such bits. This would be a fine comment without it.