Closed zkat closed 11 months ago
It looks like Andrew Hall on Twitter has started on one, but either way I'd be happy to lend a hand with a C# implementation. Sprache seems like a good place to start.
Ive had some musings about using SDLang or KDL as an alternative markup language for Avalonia, so I might take a stab at an implementation (non-Sprache based for perf reasons) some time.
I'm working on a FParsec based parser in F#: https://github.com/chan-w/kdl-dotnet
I've ported kdl4j (which is great, btw) across from java into a .NET library which I've titled kdl-net and uses the namespace KdlDotNet
The port is mostly literal but I've tweaked it very slightly to fit C# better. It's not quite complete (I still need to add floating point number support as at 15 jan 2021) but everything else is there, and has good test coverage thanks to kdl4j
Aside: I hadn't seen this issue earlier. I didn't realize Andrew hall was also doing one
@borland @chan-w did anything ever come of your implementations? :)
@zkat not that I'm aware of. 7 people starred it on github, and the nuget package has 259 downloads, but I don't know that anyone ever used it for more than just messing around.
I had some fun chats with people at work, and we did seriously consider using it for configuring real asp.net core apps, rather than JSON. Everyone thought it was cool, and a nice improvement - but ultimately we didn't care enough about config to warrant taking on a highly experimental new language for that.
I have been working on my own implementation, also based around kdl4j though not a direct port of it, available here. It hasn't been published on NuGet yet.
I feel as if it's ready to be used, though I am a bit lost as to how implementations are declared to be good enough or whether I could get some feedback. Either way I hope it can be useful.
Did you see my one? You're welcome to take code and testcases and stuff from it.
I don't think it was listed on the main KDL page; as with you I'm not sure how that happens, or what criteria may apply first. borland/kdl-net: A C# parser for the KDL document language (github.com) https://github.com/borland/kdl-net
Kind regards
Orion
On Fri, Jul 22, 2022 at 2:19 PM oledfish @.***> wrote:
I have been working on my own implementation, also based around kdl4j though not a direct port of it, available here https://github.com/oledfish/Kadlet. It hasn't been published on NuGet yet.
I feel as if it's ready to be used, though I am a bit lost as to how implementations are declared to be good enough or whether I could get some feedback. Either way I hope it can be useful.
— Reply to this email directly, view it on GitHub https://github.com/kdl-org/kdl/issues/51#issuecomment-1192110674, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABRWTABKWAS2DTW2IHEK3VVIAJJANCNFSM4VKI3WOA . You are receiving this because you were mentioned.Message ID: @.***>
I did take a look at it before, the additional test cases seemed interesting but I had some difficulty understanding how they related to the pre 1.0.0 spec and the new one so I decided to just do the file test suite.
generally, if it passes the spec test suite, then it's probably good enough to submit as an implementation and put it up on the site.
All the tests pass save for sci_notation_small
and sci_notation_large
which are ignored, those values become Infinity or 0 so there's a loss of information. I thought of adding a fallback that stores the original representation as a string and falls back to it if needed, though it's more of a workaround than anything
then go ahead and PR adding it to this repo's list and the website, too! Once you've published to NuGet, I guess :)
We should have a nice .net parser for kdl. Hopefully we can also add it to the org!