digitalmars.D.learn - Is there such a JSON parser?
- torhu (4/4) Jan 01 2023 I need to parse some JSON data into various data structures, so
- Salih Dincer (5/9) Jan 01 2023 There may be suggestions that will come in handy in a discussion
- thebluepandabear (7/11) Jan 01 2023 I'm new to D and also haven't found any solid JSON libraries.
- torhu (5/7) Jan 02 2023 I had a look at that, but I think it just loads the whole file
- SealabJaster (9/13) Jan 02 2023 Are you asking for a SAX-styled parser for JSON?
- torhu (2/3) Jan 02 2023 Yes, I actually want to replace a SAX parser.
- Chris Piker (6/7) Jan 02 2023 I have an upcoming project (about 3-6 months away) that could
- Steven Schveighoffer (6/10) Jan 02 2023 It's pretty rough-edged, but https://code.dlang.org/packages/jsoniopipe
- torhu (3/13) Jan 02 2023 Thank, I can check it out.
I need to parse some JSON data into various data structures, so I'm looking for a parser based on events or ranges. One that doesn't just load the file and build a data structure that represents the whole thing. So not std.json, at least.
Jan 01 2023
On Sunday, 1 January 2023 at 23:28:12 UTC, torhu wrote:I need to parse some JSON data into various data structures, so I'm looking for a parser based on events or ranges. One that doesn't just load the file and build a data structure that represents the whole thing. So not std.json, at least.There may be suggestions that will come in handy in a discussion that here: https://forum.dlang.org/thread/wtnxglafyxhscspqcdwj forum.dlang.org SDB 79
Jan 01 2023
On Sunday, 1 January 2023 at 23:28:12 UTC, torhu wrote:I need to parse some JSON data into various data structures, so I'm looking for a parser based on events or ranges. One that doesn't just load the file and build a data structure that represents the whole thing. So not std.json, at least.I'm new to D and also haven't found any solid JSON libraries. Unfortunately a massive downside for D is the fact that the ecosystem is very small when compared to other languages such as Java. You might want to try the following: https://github.com/libmir/asdf
Jan 01 2023
On Monday, 2 January 2023 at 05:44:33 UTC, thebluepandabear wrote:You might want to try the following: https://github.com/libmir/asdfI had a look at that, but I think it just loads the whole file into it's own data structure. And then you can use attributes to get it to fill structs with data, but that's too basic for my needs.
Jan 02 2023
On Sunday, 1 January 2023 at 23:28:12 UTC, torhu wrote:I need to parse some JSON data into various data structures, so I'm looking for a parser based on events or ranges. One that doesn't just load the file and build a data structure that represents the whole thing. So not std.json, at least.Are you asking for a SAX-styled parser for JSON? Similarly - what would you like to see from a full-featured JSON module? For context: I'm currently (very slowly) working on a -betterC library. The JSON lexer is able to work off of buffered data streams instead of flat in-memory arrays. So even if what you're looking for doesn't exist right now, I'd like to try and (again; very slowly) change that.
Jan 02 2023
On Monday, 2 January 2023 at 14:56:27 UTC, SealabJaster wrote:Are you asking for a SAX-styled parser for JSON?Yes, I actually want to replace a SAX parser.
Jan 02 2023
On Monday, 2 January 2023 at 14:56:27 UTC, SealabJaster wrote:Are you asking for a SAX-styled parser for JSON?I have an upcoming project (about 3-6 months away) that could make use of this as well. If you need someone to try it out please let me know and I'll give it a spin. Good luck on your library. Cheers,
Jan 02 2023
On 1/1/23 6:28 PM, torhu wrote:I need to parse some JSON data into various data structures, so I'm looking for a parser based on events or ranges. One that doesn't just load the file and build a data structure that represents the whole thing. So not std.json, at least.It's pretty rough-edged, but https://code.dlang.org/packages/jsoniopipe will do this. It has mechanisms to jump to specific object members, and to rewind to a cached point. It does not use any intermediate representation. -Steve
Jan 02 2023
On Monday, 2 January 2023 at 21:36:10 UTC, Steven Schveighoffer wrote:On 1/1/23 6:28 PM, torhu wrote:Thank, I can check it out.I need to parse some JSON data into various data structures, so I'm looking for a parser based on events or ranges. One that doesn't just load the file and build a data structure that represents the whole thing. So not std.json, at least.It's pretty rough-edged, but https://code.dlang.org/packages/jsoniopipe will do this. It has mechanisms to jump to specific object members, and to rewind to a cached point. It does not use any intermediate representation. -Steve
Jan 02 2023