-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why? (explain it on website) #74
Comments
@GabrielGorta thank you for asking, here are a few reasons:
We could add some more examples like these to the site. |
Well, this explanation should be fine to mentoy on website. Also JSON can be formated the way that on one line is only one value from array, so practically all the reasons you mentoyed would be possible with just JSON, no need of parsing... [
{ "a": "b" }
] is fine, but in case of: [
{
"a": "b"
}
] is problem. In JSONL, it's not, because it's always JSON per line, but this needs to be explained on website. |
JSON is not a streamable format, formatting it for human consumption has nothing to do with it. |
Not fine. You have a single element in that array, as soon as you have another you'd need a trailing comma. JSON5 or JSONC allows for omitting any trailing comma I think, but still would need to be array wrapped. asciinema uses JSONL for |
And what is problem with trailing comma? it can simply remove that, when selecting specific line (or JSON), and you still have valid JSON. E.g. in terminal, when I do grep, I just pipe it to func that removes ending trailing comma (if there is) from string. Before it even goes to parser. Removing last character from string is not costly at all. I don't see difference when as "separator" is |
Yes but the reasons have been cited above already.
You can transform JSON to JSONL, with the more practical approach being through something like The advantage with JSONL is as mentioned streaming, you can output data from one program as it's ready, while the other program ingests it as it arrives, without blocking on waiting for the full document to be constructed (if one even would be "completed", such as reading a file that's appended to frequently (eg: logs). |
|
JSON:
JSONL
what is difference, except additional
[
and]
in JSON?The text was updated successfully, but these errors were encountered: