YAML

I was thinking about writing a YAML parser. Any interest in the community for this?

have you seen the one I wrote a few months back?

I have not, where?

https://forum.xojo.com/49444-markdown-class-for-xojo-now-available

Before I download, are you sure this will support YAML?

https://yaml.org

Ok… .Mine is YET ANOTHER MARKDOWN … guess I mis-understood what YAML is

I need one actually and could contribute some funds to it if necessary.

Can you send me an example file of what you might need to parse? Perhaps I can start with a subset and build out.

I have thought about writing a parser in the past. I try to avoid YAML where I can but sometimes it is out of your control.

—sb

You may be interested in an (faster) alternative to JSON and YAML called MessagePack, since you like speed alot and there is no Xojo implementation yet.

See here: https://msgpack.org

Gee, I was just thinking, “what the heck am I going to do with all this free time?”, then you come along with this suggestion. Thanks a lot, @Derk Jochems .

:stuck_out_tongue:

In seriousness, this does look pretty easy to implement. The only question is, how to handle serialization of objects? Implement a standard way or let the consumer do it?

both.
implement a standard way, and let the possibility to override it if needed.

[quote=419695:@Kem Tekinay]Gee, I was just thinking, “what the heck am I going to do with all this free time?”, then you come along with this suggestion. Thanks a lot, @Derk Jochems .

:p[/quote]

you only have hours if you wanna fix it this year still…:wink:

It should be defined, isn’t it? Otherwise an encapsulated class may fit the purpose, just like JSONItem is now with JSON.

If you give JSONItem an instance of your own class, it will throw an error. It’s up to you to serialize it first, but it looks like this is designed around object serialization through extensions. Beyond that, it’s not defined.

I meant like having a class MessagePackItem basicly being a dictionary as JSONItem. Leave the rest to the developer what to do with it.

If you really want to break your brain, check out ProtocolBuffers https://developers.google.com/protocol-buffers/

I wrote a very simple and partial decoder for this format, and got enough understanding to know I don’t like it.

TL;DR: it’s a lot of effort to save a few bytes, and has some (IMHO) bad design choices.

if you need inspiration, take a look to BinaryMessage spec. already working in a product.