www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - The XML and JSON library

reply Szabo Bogdan <szabobogdan yahoo.com> writes:
Hi!

I think that there are a few years since, the phobos support for 
XML and JSON were kind of drooped. The xml library it's 
deprecated and I am not sure if I should use it... I guess not... 
I guess there is nobody working for a replacement.

Related to Json... I guess that I am not the only one that thinks 
that the interface of that library it's quite bad... and when I 
also want to use Json, I use the vibe.d structures... I like what 
it's done there, but I think it's sad that I have to include 
vibe.d just to have a Json serialiser.

Does anyone know what it's the status of these libraries?

Thanks,
Bogdan
Sep 25 2016
next sibling parent Ilya Yaroshenko <ilyayaroshenko gmail.com> writes:
On Sunday, 25 September 2016 at 08:19:22 UTC, Szabo Bogdan wrote:
 Hi!

 I think that there are a few years since, the phobos support 
 for XML and JSON were kind of drooped. The xml library it's 
 deprecated and I am not sure if I should use it... I guess 
 not... I guess there is nobody working for a replacement.

 Related to Json... I guess that I am not the only one that 
 thinks that the interface of that library it's quite bad... and 
 when I also want to use Json, I use the vibe.d structures... I 
 like what it's done there, but I think it's sad that I have to 
 include vibe.d just to have a Json serialiser.

 Does anyone know what it's the status of these libraries?

 Thanks,
 Bogdan
https://github.com/tamediadigital/asdf and https://github.com/tamediadigital/je may be really useful for production.
Sep 25 2016
prev sibling parent reply Basile B. <b2.temp gmx.com> writes:
On Sunday, 25 September 2016 at 08:19:22 UTC, Szabo Bogdan wrote:
 Hi!

 I think that there are a few years since, the phobos support 
 for XML and JSON were kind of drooped. The xml library it's 
 deprecated and I am not sure if I should use it... I guess 
 not... I guess there is nobody working for a replacement.
Wrong. Someone worked on a replacement this summer, in the context of the gsoc: https://github.com/dlang/phobos/pull/4741
Sep 25 2016
next sibling parent Mike Parker <aldacron gmail.com> writes:
On Sunday, 25 September 2016 at 08:26:58 UTC, Basile B. wrote:
 On Sunday, 25 September 2016 at 08:19:22 UTC, Szabo Bogdan 
 wrote:
 Hi!

 I think that there are a few years since, the phobos support 
 for XML and JSON were kind of drooped. The xml library it's 
 deprecated and I am not sure if I should use it... I guess 
 not... I guess there is nobody working for a replacement.
Wrong. Someone worked on a replacement this summer, in the context of the gsoc: https://github.com/dlang/phobos/pull/4741
And, FYI, there's a guest post about the GSoC project in the D Blog queue.
Sep 25 2016
prev sibling parent reply Lodovico Giaretta <lodovico giaretart.net> writes:
On Sunday, 25 September 2016 at 08:26:58 UTC, Basile B. wrote:
 On Sunday, 25 September 2016 at 08:19:22 UTC, Szabo Bogdan 
 wrote:
 Hi!

 I think that there are a few years since, the phobos support 
 for XML and JSON were kind of drooped. The xml library it's 
 deprecated and I am not sure if I should use it... I guess 
 not... I guess there is nobody working for a replacement.
Wrong. Someone worked on a replacement this summer, in the context of the gsoc: https://github.com/dlang/phobos/pull/4741
And... It's almost ready. I just have to find some time to finish up some bits and add more documentation.
Sep 25 2016
next sibling parent reply Chris <wendlec tcd.ie> writes:
On Sunday, 25 September 2016 at 09:12:03 UTC, Lodovico Giaretta 
wrote:
 On Sunday, 25 September 2016 at 08:26:58 UTC, Basile B. wrote:

 And... It's almost ready. I just have to find some time to 
 finish up some bits and add more documentation.
When will this happen (roughly)? I'm looking forward to it because I need proper SSML support[1], which is XML really. [1] https://en.wikipedia.org/wiki/Speech_Synthesis_Markup_Language
Sep 26 2016
parent Lodovico Giaretta <lodovico giaretart.net> writes:
On Monday, 26 September 2016 at 09:29:55 UTC, Chris wrote:
 On Sunday, 25 September 2016 at 09:12:03 UTC, Lodovico Giaretta 
 wrote:
 On Sunday, 25 September 2016 at 08:26:58 UTC, Basile B. wrote:

 And... It's almost ready. I just have to find some time to 
 finish up some bits and add more documentation.
When will this happen (roughly)? I'm looking forward to it because I need proper SSML support[1], which is XML really. [1] https://en.wikipedia.org/wiki/Speech_Synthesis_Markup_Language
Sorry for the late reply. I'm trying to find some time to finish it. If I manage to find it soon, I may finish in a couple of weeks. In the worst case scenario, I may finish it before Christmas. I know this may not be good news, but since the start of September I'm really having a hard time trying to find some free time.
Sep 28 2016
prev sibling parent reply Szabo Bogdan <szabobogdan yahoo.com> writes:
On Sunday, 25 September 2016 at 09:12:03 UTC, Lodovico Giaretta 
wrote:
 On Sunday, 25 September 2016 at 08:26:58 UTC, Basile B. wrote:
 On Sunday, 25 September 2016 at 08:19:22 UTC, Szabo Bogdan 
 wrote:
 Hi!

 I think that there are a few years since, the phobos support 
 for XML and JSON were kind of drooped. The xml library it's 
 deprecated and I am not sure if I should use it... I guess 
 not... I guess there is nobody working for a replacement.
Wrong. Someone worked on a replacement this summer, in the context of the gsoc: https://github.com/dlang/phobos/pull/4741
And... It's almost ready. I just have to find some time to finish up some bits and add more documentation.
Awesome! I guess the interface of the `std.experimental.xml` package will not change too soon... and I guess that I can assume that I can try to use it in my projects... How about Json... there is something that is stopping the D community to move the `vibe.data.json` to `phobos`?
Sep 28 2016
next sibling parent reply Lodovico Giaretta <lodovico giaretart.net> writes:
On Wednesday, 28 September 2016 at 21:40:12 UTC, Szabo Bogdan 
wrote:
 Awesome!

 I guess the interface of the `std.experimental.xml` package 
 will not change too soon... and I guess that I can assume that 
 I can try to use it in my projects...
Definitely give it a try and if you have something to say about it, say it! I need some usage reports to understand if the design works well, and what are the limitations, because XML is used in many different contexts with many different needs and it's difficult to get a complete idea without many users.
 How about Json... there is something that is stopping the D 
 community to move the `vibe.data.json` to `phobos`?
It has already been proposed [1]. I cannot find the discussion thread currently. [1] https://code.dlang.org/packages/std_data_json
Sep 28 2016
parent Seb <seb wilzba.ch> writes:
On Wednesday, 28 September 2016 at 21:53:52 UTC, Lodovico 
Giaretta wrote:
 It has already been proposed [1]. I cannot find the discussion 
 thread currently.

 [1] https://code.dlang.org/packages/std_data_json
Not the thread, but status: https://github.com/s-ludwig/std_data_json/issues/24
Oct 01 2016
prev sibling next sibling parent Chris <wendlec tcd.ie> writes:
On Wednesday, 28 September 2016 at 21:40:12 UTC, Szabo Bogdan 
wrote:
 On Sunday, 25 September 2016 at 09:12:03 UTC, Lodovico Giaretta 
 wrote:
 On Sunday, 25 September 2016 at 08:26:58 UTC, Basile B. wrote:
 On Sunday, 25 September 2016 at 08:19:22 UTC, Szabo Bogdan 
 wrote:
 [...]
Wrong. Someone worked on a replacement this summer, in the context of the gsoc: https://github.com/dlang/phobos/pull/4741
And... It's almost ready. I just have to find some time to finish up some bits and add more documentation.
Awesome! I guess the interface of the `std.experimental.xml` package will not change too soon... and I guess that I can assume that I can try to use it in my projects... How about Json... there is something that is stopping the D community to move the `vibe.data.json` to `phobos`?
Yeah, I was thinking of using it anyway, because it won't change substantially, if it's only about the docs now (more or less).
Sep 29 2016
prev sibling parent reply Nick Sabalausky <SeeWebsiteToContactMe semitwist.com> writes:
On 09/28/2016 05:40 PM, Szabo Bogdan wrote:
 How about Json... there is something that is stopping the D community to
 move the `vibe.data.json` to `phobos`?
Why does it need to be in phobos? It's already usable as-is. Only libraries within a std lib are valid?
Sep 29 2016
parent reply Szabo Bogdan <szabobogdan yahoo.com> writes:
On Thursday, 29 September 2016 at 14:46:10 UTC, Nick Sabalausky 
wrote:
 On 09/28/2016 05:40 PM, Szabo Bogdan wrote:
 How about Json... there is something that is stopping the D 
 community to
 move the `vibe.data.json` to `phobos`?
Why does it need to be in phobos? It's already usable as-is. Only libraries within a std lib are valid?
Well... the json format can be used in a lot of cases not only for the web and I think it does not make much sense to include a web framework in order to use this format. Since it a a general purpose format, I don't see why it could not be included in phobos. Phobos has already a json library, which is barely usable. I guess that a lot of people are using the vibe.d's json instead of the one from Phobos. Anyway... right now vibe.d it's split in sub packages and I can include only the data package if I need it... I'm asking because it would be nice if there would be a json structure in Phobos with an interface at least as good as the one from vibe.
Sep 29 2016
next sibling parent reply cym13 <cpicard openmailbox.org> writes:
On Thursday, 29 September 2016 at 20:14:27 UTC, Szabo Bogdan 
wrote:
 On Thursday, 29 September 2016 at 14:46:10 UTC, Nick Sabalausky 
 wrote:
 [...]
Well... the json format can be used in a lot of cases not only for the web and I think it does not make much sense to include a web framework in order to use this format. Since it a a general purpose format, I don't see why it could not be included in phobos. Phobos has already a json library, which is barely usable. I guess that a lot of people are using the vibe.d's json instead of the one from Phobos. Anyway... right now vibe.d it's split in sub packages and I can include only the data package if I need it... I'm asking because it would be nice if there would be a json structure in Phobos with an interface at least as good as the one from vibe.
It's not as if it were the only json library though, asdf for example isn't linked to any web framework https://github.com/tamediadigital/asdf
Sep 29 2016
parent reply Chris <wendlec tcd.ie> writes:
On Thursday, 29 September 2016 at 21:32:03 UTC, cym13 wrote:

 It's not as if it were the only json library though, asdf for 
 example isn't linked to any web framework 
 https://github.com/tamediadigital/asdf
I like the name `asdf` (it's the same I type when I need random text input). Is there a tutorial / blog / article about it? Maybe it needs more promotion. For the moment it says: ` ! Currently all ASDF Method names and all UDAs are in DRAFT state, we might want want make them simpler. Please submit an Issue if you have input. ! ASDF is currently only very loosely validating jsons and with certain functions even silently and on purpose ignoring failing Objects (see below). ` So not sure, if it's 100% usable.
Sep 30 2016
next sibling parent reply cym13 <cpicard openmailbox.org> writes:
On Friday, 30 September 2016 at 09:41:55 UTC, Chris wrote:
 On Thursday, 29 September 2016 at 21:32:03 UTC, cym13 wrote:

 It's not as if it were the only json library though, asdf for 
 example isn't linked to any web framework 
 https://github.com/tamediadigital/asdf
I like the name `asdf` (it's the same I type when I need random text input). Is there a tutorial / blog / article about it? Maybe it needs more promotion. For the moment it says: ` ! Currently all ASDF Method names and all UDAs are in DRAFT state, we might want want make them simpler. Please submit an Issue if you have input. ! ASDF is currently only very loosely validating jsons and with certain functions even silently and on purpose ignoring failing Objects (see below). ` So not sure, if it's 100% usable.
Not sure dmd's 100% usable either but that doesn't mean I'm just ignoring it ;) My point was just that there are alternatives and that as much as I'd like to see a new JSON lib in phobos a non-standard library is still a library.
Sep 30 2016
parent Chris <wendlec tcd.ie> writes:
On Friday, 30 September 2016 at 18:04:32 UTC, cym13 wrote:
 On Friday, 30 September 2016 at 09:41:55 UTC, Chris wrote:
 [...]
Not sure dmd's 100% usable either but that doesn't mean I'm just ignoring it ;) My point was just that there are alternatives and that as much as I'd like to see a new JSON lib in phobos a non-standard library is still a library.
You know what I mean ;)
Sep 30 2016
prev sibling parent reply yawniek <yawniek srtnwz.com> writes:
On Friday, 30 September 2016 at 09:41:55 UTC, Chris wrote:
 On Thursday, 29 September 2016 at 21:32:03 UTC, cym13 wrote:

 It's not as if it were the only json library though, asdf for 
 example isn't linked to any web framework 
 https://github.com/tamediadigital/asdf
I like the name `asdf` (it's the same I type when I need random text input). Is there a tutorial / blog / article about it? Maybe it needs more promotion. For the moment it says: ` ! Currently all ASDF Method names and all UDAs are in DRAFT state, we might want want make them simpler. Please submit an Issue if you have input. ! ASDF is currently only very loosely validating jsons and with certain functions even silently and on purpose ignoring failing Objects (see below). ` So not sure, if it's 100% usable.
its definitly 100% usabe, we use it in production. and it has a much easier API than all the other libs. we created it especially for the purpose of easy (and blazing fast!) data extraction from json. give it a spin and report feedback. unfortunately i have not had the time yet to write a more detailed blog article. The reason the warning is there is: - validation: we usually do not care about a few corrupt records within millions, thus there is this feature to silently ignore those, i think you still can make these records fail loudly. - we don't know yet where asdf is bad at, thus we need more feedback - we are open to change the naming convention of the attributes if someone comes up with good reasoning
Oct 01 2016
parent cym13 <cpicard openmailbox.org> writes:
On Saturday, 1 October 2016 at 13:43:02 UTC, yawniek wrote:
 On Friday, 30 September 2016 at 09:41:55 UTC, Chris wrote:
 [...]
its definitly 100% usabe, we use it in production. and it has a much easier API than all the other libs. we created it especially for the purpose of easy (and blazing fast!) data extraction from json. give it a spin and report feedback. unfortunately i have not had the time yet to write a more detailed blog article. The reason the warning is there is: - validation: we usually do not care about a few corrupt records within millions, thus there is this feature to silently ignore those, i think you still can make these records fail loudly. - we don't know yet where asdf is bad at, thus we need more feedback - we are open to change the naming convention of the attributes if someone comes up with good reasoning
It would definitely be great to see an article about asdf for the D blog IMHO. I'd like to see it in action in a real case as thoses are much better at showing the strength of the library. If you could throw some time at it it would be awesome.
Oct 01 2016
prev sibling parent reply Nick Sabalausky <SeeWebsiteToContactMe semitwist.com> writes:
On 09/29/2016 04:14 PM, Szabo Bogdan wrote:
 On Thursday, 29 September 2016 at 14:46:10 UTC, Nick Sabalausky wrote:
 On 09/28/2016 05:40 PM, Szabo Bogdan wrote:
 How about Json... there is something that is stopping the D community to
 move the `vibe.data.json` to `phobos`?
Why does it need to be in phobos? It's already usable as-is. Only libraries within a std lib are valid?
Well... the json format can be used in a lot of cases not only for the web and I think it does not make much sense to include a web framework in order to use this format.
You don't have to USE the web framework stuff to the use json part. This sort of question has come up before, but I've really never understood the problem. Sounds more ideologic than anything real to me.
Sep 29 2016
parent Rene Zwanenburg <renezwanenburg gmail.com> writes:
On Friday, 30 September 2016 at 03:27:36 UTC, Nick Sabalausky 
wrote:
 You don't have to USE the web framework stuff to the use json 
 part.

 This sort of question has come up before, but I've really never 
 understood the problem. Sounds more ideologic than anything 
 real to me.
Since Vibe has been split into subpackages it's not an issue anymore, but before that I copied Vibe's Json code into my project so I didn't need to depend on the entire Vibe codebase. DMD ICE's are much, much less frequent than they were a few years ago, but with largish projects I still regularly run into them, which is a reason for me to not include more code than necessary.
Sep 30 2016