2 ms·
I guess I didn't explain well enough, since you completely misunderstood my suggestion. Separate tools have the advantage (over regex) of handling nesting prop
by stcredzero 14y ago
I guess I didn't explain well enough, since you completely misunderstood my suggestion.
Separate tools have the advantage (over regex) of handling nesting properly, which could certainly be significant.
Okay, thanks, but I've known about basic automata theory since I was an undergrad, two decades ago.
I had something like this in mind:
ls -af | jsonify 'ls -af' | this_reads_a_json_stream
The jsonify command would retrieve and run a script from a central repository, which people could contribute code to. This way, the parsing efforts of one coder could be re-used by the rest of the world.
- dllthomas 14y ago>Okay, thanks, but I've known about basic automata theory since I was an undergrad, two decades ago. I wasn't trying to educate; I was discussing the relevant limitations of my approach. The fact that I can't spin a perfect regexp for anything (including JSON, sexp, xml) that nests arbitrarily deeply is an issue with what I proposed - one that I think can be worked around sufficiently, but an issue nonetheless, and I wanted to acknowledge that. I don't see what prompted the defensiveness I take from your comment - I'd expect most people here to know at least that much automata theory, here. I've not known it for quite two decades, but two decades ago I was 8. I'll reply to the constructive bits of your response separately.
- stcredzero 14y agoI wasn't trying to educate; I was discussing the relevant limitations of my approach. Oh, sorry, I thought you were implying that about my approach.
- dllthomas 14y agoAh, gotcha. Yeah, that would have been incoherent.
- dllthomas 14y agoIt appears that I did misunderstand your suggestion - I'd thought you to be proposing a separate set of tools (grep, sed, etc) for operating on each packet format. Instead, it appears you meant a set of tools for converting output to a particular format? That still means either 1) reimplementing tools to deal with each format, or 2) many conversions and perhaps still an inability to get the data to chunk the desired way for any particular tool. Just the ability to have sed, grep, and sort chunk in an arbitrary way would be significant.
- stcredzero 14y agoIf one could simply get all of the data parsed to a particular format, people using such tools could easily pick which data they need and discard the rest. Also, there would be "many conversions" - but I'm envisioning that these would be shared in a library, so it would "just work" for most developers.