Replies: 3 comments 3 replies
-
|
Related, I'm starting to think of a value object as a chunk of text. This allows one to output values without round tripping them through a parser and "normalizing" it, which can be a weird experience as a user: you output a value and can't use ctrl+f to find it in the file. It also means we have a way forward for a json build interface, and even an edit interface (read input -> replace / insert / delete -> output). |
Beta Was this translation helpful? Give feedback.
-
The scenario where someone has a 6 GB JSON file is a very real challenge but it might be acceptable to make the design decision that we just do not support such inputs. We would just clearly state it, and tell people who have such files to just use another tool. We should make this deliberate design decision before we take steps to block ourselves off from such extensions. For context, here is what the JSON specification says... It is already the case that a 6 GB JSON file won't be supported by many systems. I would argue that most users who have such large files should prefer ndjson or other formats (where we do support really large files). |
Beta Was this translation helpful? Give feedback.
-
|
On demand has to know the core value of action and the position of action in relation to embedded memory then uses ram+action=unallocated values+drive location=requests then uses a self created algorithm called most plausible possible position or point of origin "Fahujera" |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
So, the only real difference between the DOM and On Demand APIs, from a user point of view, is that On Demand can't access things out of order. (It's true that we made an exception to this for objects, but for the purposes of this discussion, let's view that as a one-off.)
I propose we remove this restriction, treating On Demand as what it currently is: a full index of structurals. Values store their start_index (though I believe it's optimized away). I propose we use that start_index to access values instead of relying solely on the global cursor.
Pros
DOM Equivalence: The On Demand API is already 90% compatible with the DOM, which has usability on a level with gold standards like nlohmann_json. The 90% compatible is probably the right 90% (the most common use cases). Making this change would buy us the other 10%, making switching easy.
Sharp Edge Elimination: Right now, you can still get errors because you introduced out of order access--or worse, got inexplicably bad behavior at runtime because you compiled in release instead of debug mode. It can be hard to understand these errors. We could improve error messages, but these are still poky edges. These will make some people think twice about using or recommending simdjson. This change would eliminate all (or 99.9%) of those sharp edges.
It's not theoretical, either: when writing examples, I wrote make_pair<double, double>(object["x"], object["y"]), and it failed at runtime. This happened because the cursor moved from x to y.
Concerns
value.start_index = iter.index; *value.start_indexand just use*iter.index.Beta Was this translation helpful? Give feedback.
All reactions