www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Better SDLang

reply solidstate1991 <laszloszeremi outlook.com> writes:
Since I have a lot of formats created for the SDLang format and I 
have yet to see a format that would be a good replacement for its 
place (especially for my own usecases), I was thinking on writing 
my own parser with a better API (allowing for keeping the 
comments at their place, etc.), cleaned up type support (reducing 
the number of integer types to one, maybe even the floating point 
numbers too), more formatting options (like hexadecimal numbers) 
etc. I will also try to look into some automatic serialization 
methods.

I'm currently in the process of doing some research on what kind 
of gripe people have with the current SDLang implementation, both 
API and and textual representation level. Then I'll design a 
class structure for the parsers (Yes, I'll also create a more 
SAX-like parser too in conjunction of the DOM parser).
Jul 22
next sibling parent drug007 <drug2004 bk.ru> writes:
On 22.07.2024 20:25, solidstate1991 wrote:
 Since I have a lot of formats created for the SDLang format and I have 
 yet to see a format that would be a good replacement for its place 
 (especially for my own usecases), I was thinking on writing my own 
 parser with a better API (allowing for keeping the comments at their 
 place, etc.), cleaned up type support (reducing the number of integer 
 types to one, maybe even the floating point numbers too), more 
 formatting options (like hexadecimal numbers) etc. I will also try to 
 look into some automatic serialization methods.
 
 I'm currently in the process of doing some research on what kind of 
 gripe people have with the current SDLang implementation, both API and 
 and textual representation level. Then I'll design a class structure for 
 the parsers (Yes, I'll also create a more SAX-like parser too in 
 conjunction of the DOM parser).
[Offtopic] What do you think about https://kdl.dev? ``` The language is based on SDLang, with a number of modifications and clarifications on its syntax and behavior. ``` There is no D implementation for it between
Jul 22
prev sibling next sibling parent Guillaume Piolat <first.name gmail.com> writes:
On Monday, 22 July 2024 at 17:25:37 UTC, solidstate1991 wrote:
 I'm currently in the process of doing some research on what 
 kind of gripe people have with the current SDLang 
 implementation, both API and and textual representation level. 
 Then I'll design a class structure for the parsers (Yes, I'll 
 also create a more SAX-like parser too in conjunction of the 
 DOM parser).
I had such gripes today. - basically sdlang-d comes with dependencies, that then create warnings. Well I never chose to use sdlang in the first place, so it's annoying to get unrelated warnings on top of that :) - GitHub README has no parsing example to copy/paste - the code looks a bit less good on screen than eg. parsing JSON with std.json ```d result.name = dubFile["name"].str; foreach(e; dubFile["versions"].array) { if (e.str == "flobber") result.flobber = true; } ``` vs ```d result.name = sdlFile.getTagValue!string("name"); foreach(e; sdlFile.getTag("versions").values) { if (e.get!string() == "flobber") result.flobber = true; } ``` but I've not tried the 5(!) alternatives already on DUB.
Jul 22
prev sibling parent solidstate1991 <laszloszeremi outlook.com> writes:
https://github.com/ZILtoid1991/newsdlang

Created the repository, but likely won't start working on it 
immediately.

It will be a combined SDLang/KDL(an SDLang-inspired declarative 
language)/XDL(my own modified SDLang implementation) reader and 
writer.
Jul 24