user-pic

tinita

Subscribe to feed Recent Actions from tinita

  • Leon Timmermans commented on Introducing IOD file format

    Have you taken a look at [TOML](https://github.com/toml-lang/toml)? IMO it provides a much more sensible paradigm than INI, while still being intuitive enough for most people. There are already two parser for it in Perl.

  • perlancar commented on Introducing IOD file format

    I have. I guess TOML is okay for configuration format too, although it diverges quite a bit from INI. My goal with IOD is to be compatible enough with INI, to be interchangeble enough. Also, I'm not seeing a TOML round-trip parser yet, something which I intend to create for IOD.

  • KENTNL commented on Introducing IOD file format

    > In IOD you can also use this syntax:
    >
    > [section]
    > fruits = ["apple","orange","avocado"]

    But does this not simply re-expose the problem tinita was complaining about?

    It forces the consuming code to determine on a case-by-case basis whether it supports an array, and subsequently requires a lot of boiler plate code to automatically switch between single, and multiple values.

  • Toby Inkster commented on Introducing IOD file format

    It doesn't seem quite the same. In a traditional INI file:

    [section]
    foo=1
    bar=2
    bar=3
    

    "bar" is an array, but is "foo" a simple string, or is it an array with just one element? The INI parser will probably treat it as a simple string. If the application wants "foo" to be an array, it needs to include code to "promote" a string into a one-element array.

    With IOD, there is at least a way when writing the config file to unambiguously say "this is an array, even if it's only got one element at the moment".

  • perlancar commented on Introducing IOD file format

    Also, note that in the case of "actual data determining your data structure" IOD is not different from YAML which trinita uses: whether a parameter is scalar or array is still determined by the config. Config::MVP is different in that it uses some sort of "outside schema" to specify that a parameter needs to have a certain form/value.

Subscribe to feed Responses to Comments from tinita

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.