Skip to content
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

JSON builder #1386

Open
lemire opened this issue Jan 9, 2021 · 12 comments
Open

JSON builder #1386

lemire opened this issue Jan 9, 2021 · 12 comments
Assignees
Labels
enhancement New feature or request

Comments

@lemire
Copy link
Member

lemire commented Jan 9, 2021

Some users would like simdjson to help build JSON files.

See discussion at #2086

cc @jkeiser

@jkeiser
Copy link
Member

jkeiser commented Jan 21, 2021

#1327 is related and probably duplicate.

@jkeiser
Copy link
Member

jkeiser commented Jan 21, 2021

The fastest way to get this done is definitely to create a new API for it. However, users often want the ability to edit, so a DOM builder is probably OK as well (though it would be more complicated).

As for On Demand, there are possibilities for speed: since On Demand already knows the JSON text for each existing token, it can preserve that text and insert/delete values by slicing and dicing the existing text and adding new text chunks via something like a rope. (Without a rope, one is likely going to spend a lot of time copying in the insert/delete case.)

@lemire
Copy link
Member Author

lemire commented Jan 21, 2021

I think that @xelatihy's issue is only for On Demand.

@xelatihy
Copy link

xelatihy commented Jan 28, 2021

For many needs, and ours certainly, OnDemand is a preference and editing is not. Meaning that creating/serializing JSON in a "streaming" fashion is fine. Editing requires a significant more complex API and, I am assuming, implementation.

@nmaludy
Copy link

nmaludy commented Dec 21, 2021

+1 Would like to see this as well.

@AsterDY
Copy link

AsterDY commented Jan 4, 2022

+1 Would like to see this as well.

  • 10000x. No-Builder-Support will definitely limit your libs' applicability and practicability

@paulocoutinhox
Copy link

+1 Please!

1 similar comment
@wangjieest
Copy link

+1 Please!

@FranciscoThiesen
Copy link
Member

@lemire I will start working on this!

@FranciscoThiesen
Copy link
Member

@lemire even though this is likely to be a multi-person effort, can you assign it to me?

@lemire lemire assigned lemire and FranciscoThiesen and unassigned lemire Feb 20, 2024
@lemire
Copy link
Member Author

lemire commented Feb 20, 2024

@FranciscoThiesen I just did.

Note that I recommend starting small. Do not try to solve the problem at once. Just implement something. There will be plenty of feedback.

@Steveantor
Copy link

Any progress updates 👏? @FranciscoThiesen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants