YAML support?
YAML support?
Hi,
ok, there is JSON but even in it's "pretty" version
I find it hard to read / hard to skim quickly over it's content.
Has anyone ever written a module for PB to support YAML (http://www.yaml.org/)
that supports writing to / reading from a file, set and get keys, values, ...?
ok, there is JSON but even in it's "pretty" version
I find it hard to read / hard to skim quickly over it's content.
Has anyone ever written a module for PB to support YAML (http://www.yaml.org/)
that supports writing to / reading from a file, set and get keys, values, ...?
Re: YAML support?
I'll add my name here, has anyone already done something along these lines?
At least read it?
At least read it?
SPAMINATOR NR.1
Re: YAML support?
I've been looking for it too. I'll try write a module this weekend and get back here.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: YAML support?
You're definitely not the only interested one, I'd pick up a module if someone wrote it for sureSTARGÅTE wrote: Fri Dec 06, 2024 7:14 pm I've been looking for it too. I'll try write a module this weekend and get back here.

Re: YAML support?
Just for the note, I'd also pick up such a module.
Re: YAML support?
There is a C lib for this if you can use it as base for your module: https://github.com/yaml/libyaml
Re: YAML support?
Thanks Fred.
However, while reading the full documentation of YAML, I realized that YAML has a much more complex specification than JSON or XML.
So, that will take some time ^^
@All:
I think I would avoid the use of the RegularExpression lib, to keep the module free of the PCRE Lizenz.
The next question is whether the module should have the PureBasic syntax:
Or should it be based on a structure:
I would prefer the latter.
However, while reading the full documentation of YAML, I realized that YAML has a much more complex specification than JSON or XML.

So, that will take some time ^^
@All:
I think I would avoid the use of the RegularExpression lib, to keep the module free of the PCRE Lizenz.
The next question is whether the module should have the PureBasic syntax:
Code: Select all
#YAML = 1
ParseYAML(#YAML, "[1, 1.23, 1.23e-3]")
Debug GetYAMLDouble(GetYAMLElement(YAMLValue(#YAML), 0))
Code: Select all
Define YAML.YAML
ParseYAML(@YAML, "[1, 1.23, 1.23e-3]")
Debug YAML\NodeTree\Element(0)\Double
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: YAML support?
For me it's secondary. I prefer the former, but still would be happy with the latter.
Re: YAML support?
YAML has a lot of special cases and irregularities, so out of curiosity: where do you want to use it, why and what things does it do better than xml/json?
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: YAML support?
Now I started to feel a bit ashamed, I would not want to force anyone to do extra work for me.YAML has a lot of special cases and irregularities
It's absolutely much more readable by a human. Good for config files, but for example OpenXcom Oxce is completely scripted trough using yml files.why and what things does it do better than xml/json?
I started to become fascinated with yaml when I saw that how straightforwardly was it organized. (that was the first time I met this format.)
Re: YAML support?
I understand, but XML/json can be printed out to be human friendly readable too. You know, PrettyPrint. There are 22 variants for booleans alone in YAML and it isn't really widespread. Don't get me wrong, every addition to PureBasic is great. Like OK image format and such.
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: YAML support?
@jacdelad
I know, and Yaml is not a must for me.
If someone creates a module for him/herself, and willing to share, I would apply. Thats all.
I know, and Yaml is not a must for me.
If someone creates a module for him/herself, and willing to share, I would apply. Thats all.
Well, I did not know that. I don't think that the files I was browsing used the full capabilities yaml has.There are 22 variants for booleans alone in YAML
Re: YAML support?
YAML was especially designed to be better readable to humans. That's why it has many varieties for expressing data. And flexibility always comes with the cost of complex algorithms/libraries.
However, some popular software uses yaml, like Kubernetes, which is used by professionals, so there must be a legit reason why to prefer it over XML.
However, some popular software uses yaml, like Kubernetes, which is used by professionals, so there must be a legit reason why to prefer it over XML.
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD