views:

574

answers:

3

Anyone out there using YAML as a data DSL in .NET? I'd like to use YAML because it's more lightweight than XML. I intend to use this DSL as a "power user" configuration tool for one of my existing applications.

My concerns:

  • How is the support for YAML using one of the .NET community libraries?
  • Does YAML have staying power? Will it still be around 4 years from now? Or will we be talking about some other format? I know JSON and XML are going to be around for a while, but my users aren't going to want to write or maintain JSON or XML documents.
+1  A: 

If it's a user-facing document, don't worry about the 'staying power' of YAML. Worry about making the users happy with some DSL. That being said, I would choose YAML over XML.

Outside of the user-facing portion, I wouldn't use YAML for much. XML has so much more going for it *that I can imagine*, that it would be in your best interest to use something richer and more widely used (esp. by .NET).

Even if you had to create your own language to satisfy your users, it would probably be worth it to not force them to look at XML.

MStodd
I think for me the #1 advantage to use YAML would be: I don't have to invent my own data format. #2 I can reuse this YAML-to-config .NET code on other projects I'm working on.
tyndall
I want to wait for something like M/Oslo to mature before I go off and try to invent my own full-blown external DSL.
tyndall
+1 Good advice. I guess I could use a YAML-to-X converter somewhere down the line.
tyndall
+1  A: 

Have you considered instead using IronPython scripts? That way, you can not only interpret simple key-value type things, you can also add dynamic execution and calculation to your power-user configuration.

It's worth checking out, as hosting IronPython is dead simple, and the syntax is very clean and easy-to-read for users, even if they don't know Python.

Paul Betts
A: 

There are YAML libs that will construct and parse YAML, but I can't seem to find any way to serialize an arbitrary object, like XML for C# or YAML for Ruby.