[dmd-beta] D 2.062 beta

Jacob Carlborg doob at me.com
Wed Feb 13 12:29:46 PST 2013


On 13 feb 2013, at 20:37, Walter Bright <walter at digitalmars.com> wrote:

> 
> On 2/13/2013 3:06 AM, Leandro Lucarella wrote:
>> Please, don't use json for configuration files, is a format intended for
>> machines, not humans (OK, is better than XML but still horrible for
>> humans).
> 
> Json is simply a subset of javascript, which was intended for humans.
> 
>> 
>> If you need a standard and flexible file format that is almost as good
>> for humans and machines, maybe you want to consider YAML.
>> 
>> Environment:
>>   override:
>>     name: value
>>     baz: foo
>>   default:
>>     foo: bar
>> 
>> But I still think a configuration file shouldn't be as complex as YAML.
> 
> Configuration files grow ever more complex, and it'd be nice to have a format that doesn't need constant redesign.


YAML is quite a flexible format. It support references, for example.

Environment: &Environment
  foo: 1
  bar: 2

Environment64:
  <<: *Environment
  bar: 3

Here "Environment64" will contain everything in "Environment" and then override any values that is listed under "Environment64".

It's also possible to implement new types in YAML.

-- 
/Jacob Carlborg



More information about the dmd-beta mailing list