What YAML engine do you use?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Reinhold Birkenfeld

    #1

    What YAML engine do you use?

    Hello,

    I know that there are different YAML engines for Python out there (Syck,
    PyYaml, more?).

    Which one do you use, and why?

    For those of you who don't know what YAML is: visit http://yaml.org/!
    You will be amazed, and never think of XML again. Well, almost.

    Reinhold
  • Diez B. Roggisch

    #2
    Re: What YAML engine do you use?

    > I know that there are different YAML engines for Python out there (Syck,[color=blue]
    > PyYaml, more?).
    >
    > Which one do you use, and why?[/color]

    I first used yaml, tried to migrate to syck. What I like about syck is that
    it is faster and doesn't try to create objects but only dicts - but it
    crashed if the number of yaml objects grew larger. So I still use yaml.
    [color=blue]
    >
    > For those of you who don't know what YAML is: visit http://yaml.org/!
    > You will be amazed, and never think of XML again. Well, almost.[/color]

    It is certainly nice.

    --
    Regards,

    Diez B. Roggisch

    Comment

    • Jonas Galvez

      #3
      Re: What YAML engine do you use?

      Diez B. Roggisch wrote:[color=blue]
      > I first used yaml, tried to migrate to syck. What I like about
      > syck is that it is faster and doesn't try to create objects but
      > only dicts - but it crashed if the number of yaml objects grew
      > larger. So I still use yaml.[/color]

      Hmm.. I've never had any problems with syck. In fact, I'm using it in
      a small project now where I store a helluva of data in yaml files...

      Strange.

      Comment

      • Istvan Albert

        #4
        Re: What YAML engine do you use?

        Reinhold Birkenfeld wrote:
        [color=blue]
        > You will be amazed, and never think of XML again.[/color]

        XML with elementtree is what makes me never have think about XML again.

        Istvan.

        Comment

        • Irmen de Jong

          #5
          Re: What YAML engine do you use?

          Istvan Albert wrote:[color=blue]
          > XML with elementtree is what makes me never have think about XML again.[/color]

          +1 QOTW

          -Irmen

          Comment

          • Paul Rubin

            #6
            Re: What YAML engine do you use?

            Reinhold Birkenfeld <reinhold-birkenfeld-nospam@wolke7.n et> writes:[color=blue]
            > For those of you who don't know what YAML is: visit http://yaml.org/!
            > You will be amazed, and never think of XML again. Well, almost.[/color]

            Oh please no, not another one of these. We really really don't need it.

            Comment

            • rm

              #7
              Re: What YAML engine do you use?

              Paul Rubin wrote:[color=blue]
              > Reinhold Birkenfeld <reinhold-birkenfeld-nospam@wolke7.n et> writes:
              >[color=green]
              >>For those of you who don't know what YAML is: visit http://yaml.org/!
              >>You will be amazed, and never think of XML again. Well, almost.[/color]
              >
              >
              > Oh please no, not another one of these. We really really don't need it.[/color]

              well, I did look at it, and as a text format is more readable than XML
              is. Furthermore, XML's verbosity is incredible. This format is not.
              People are abusing the genericity of XML to put everything into it.

              Parsing and working with XML are highly optimized, so there's not really
              a problem in that sector. But to transfer the same data in a YAML
              format, rather than a XML format is much more economic. But networks are
              getting faster, right?

              Nowadays, people are trying to create binary XML, XML databases,
              graphics in XML (btw, I'm quite impressed by SVG), you have XSLT, you
              have XSL-FO, ... .

              And I think, YAML is a nice initiative.

              bye,
              rm

              Comment

              • Fredrik Lundh

                #8
                Re: What YAML engine do you use?

                "rm" wrote:
                [color=blue]
                > well, I did look at it, and as a text format is more readable than XML is.[/color]

                judging from http://yaml.org/spec/current.html (750k), the YAML designers are
                clearly insane. that's the most absurd software specification I've ever seen. they
                need help, not users.

                </F>



                Comment

                • A.M. Kuchling

                  #9
                  Re: What YAML engine do you use?

                  On Fri, 21 Jan 2005 18:30:47 +0100,
                  rm <rm@rm.net> wrote:[color=blue]
                  > Nowadays, people are trying to create binary XML, XML databases,
                  > graphics in XML (btw, I'm quite impressed by SVG), you have XSLT, you
                  > have XSL-FO, ... .[/color]

                  Which is an argument in favor of XML -- it's where the activity is, so it's
                  quite likely you'll encounter the need to know XML. Few projects use YAML,
                  so the chance of having to know its syntactic details is small.

                  --amk

                  Comment

                  • A.M. Kuchling

                    #10
                    Re: What YAML engine do you use?

                    On Fri, 21 Jan 2005 18:54:50 +0100,
                    Fredrik Lundh <fredrik@python ware.com> wrote:[color=blue]
                    > judging from http://yaml.org/spec/current.html (750k), the YAML designers are
                    > clearly insane. that's the most absurd software specification I've ever seen. they
                    > need help, not users.[/color]

                    IMHO that's a bit extreme. Specifications are written to be detailed, so
                    consequently they're torture to read. Seen the ReStructured Text spec
                    lately?

                    The basic idea -- a data dumping format that's human-readable -- isn't a bad
                    one. OTOH, I can't recall wanting such a thing -- when I want readable
                    output I'm happy using
                    unreadable pickle files, unpickling the object and calling a .dump() or
                    ..as_text() method.)

                    But YAML seems to have started out with the goal of being human-writable,
                    something you would write in Emacs, and that seems to have gotten lost; the
                    format is now just as complicated as Restructured Text, but more cryptic
                    (the URI namespacing for tags, for example), not really simpler than
                    XML and in some ways weaker (e.g. only two encodings supported, more
                    complicated escaping rules).

                    For a pure Python application, I can't see a need for YAML; use
                    pickle/cPickle instead, because they're already there. Exchanging
                    serialized objects between Python/Perl/Ruby scripts might be a good use case
                    for YAML, but XML has wider software support and S-expressions are simpler,
                    so my inclination would be to use them instead of YAML.

                    --amk

                    Comment

                    • Reinhold Birkenfeld

                      #11
                      Re: What YAML engine do you use?

                      A.M. Kuchling wrote:[color=blue]
                      > On Fri, 21 Jan 2005 18:54:50 +0100,
                      > Fredrik Lundh <fredrik@python ware.com> wrote:[color=green]
                      >> judging from http://yaml.org/spec/current.html (750k), the YAML designers are
                      >> clearly insane. that's the most absurd software specification I've ever seen. they
                      >> need help, not users.[/color]
                      >
                      > IMHO that's a bit extreme. Specifications are written to be detailed, so
                      > consequently they're torture to read. Seen the ReStructured Text spec
                      > lately?[/color]

                      Agreed. If you just want to use it, you don't need the spec anyway.
                      [color=blue]
                      > The basic idea -- a data dumping format that's human-readable -- isn't a bad
                      > one. OTOH, I can't recall wanting such a thing -- when I want readable
                      > output I'm happy using
                      > unreadable pickle files, unpickling the object and calling a .dump() or
                      > .as_text() method.)
                      >
                      > But YAML seems to have started out with the goal of being human-writable,
                      > something you would write in Emacs,[/color]

                      Exactly. I use it as a format for config files the user can edit
                      directly without much thinking (the explanation on top of the file are 3
                      lines).
                      [color=blue]
                      > and that seems to have gotten lost; the
                      > format is now just as complicated as Restructured Text, but more cryptic
                      > (the URI namespacing for tags, for example), not really simpler than
                      > XML and in some ways weaker (e.g. only two encodings supported, more
                      > complicated escaping rules).[/color]

                      In most cases you don't need the complicated things, and the
                      http://www.yaml.org/refcard.html isn't very complex either.

                      Reinhold

                      Comment

                      • Fredrik Lundh

                        #12
                        Re: What YAML engine do you use?

                        A.M. Kuchling wrote:
                        [color=blue]
                        > IMHO that's a bit extreme. Specifications are written to be detailed, so
                        > consequently they're torture to read. Seen the ReStructured Text spec
                        > lately?[/color]

                        I've read many specs; YAML (both the spec and the format) is easily
                        among the worst ten-or-so specs I've ever seen.

                        ReST and YAML share the same deep flaw: both formats are marketed
                        as simple, readable formats, and at a first glance, they look simple and read-
                        able -- but in reality, they're messy as hell, and chances are that the thing
                        you're looking at doesn't really mean what you think it means (unless you're
                        the official ReST/YAML parser implementation) . experienced designers
                        know how to avoid that; the ReST/YAML designers don't even understand
                        why they should.
                        [color=blue]
                        > But YAML seems to have started out with the goal of being human-writable,
                        > something you would write in Emacs, and that seems to have gotten lost; the
                        > format is now just as complicated as Restructured Text, but more cryptic
                        > (the URI namespacing for tags, for example), not really simpler than
                        > XML and in some ways weaker (e.g. only two encodings supported, more
                        > complicated escaping rules).[/color]



                        </F>



                        Comment

                        • Daniel Bickett

                          #13
                          Re: What YAML engine do you use?

                          Istvan Albert wrote:[color=blue]
                          > XML with elementtree is what makes me never have think about XML again.[/color]

                          I second that. I heard about yaml and I read into it, but when I tried
                          to use it I didn't seem to get in touch with all of the glory
                          surrounding it. The yaml module -- when I tried to use it -- was very
                          error prone, and simply didn't work. I didn't have the time to go
                          through and try to tweak it because I was pressed for time and need a
                          quick solution. As for syck, I don't know if it was just me, but when
                          I downloaded it I got a whole lot of directories with obscure names
                          and files with .c extensions. So, discouraged, I gave up on yaml.

                          Elementtree, on the other hand, is wonderful :)

                          Irmen de Jong wrote:[color=blue]
                          > +1 QOTW[/color]

                          I second that, as well.

                          here's-to-appreciating-the-end-without-having-to-be-interested-in-the-means-ly
                          y'rs
                          Daniel Bickett

                          Comment

                          • Bengt Richter

                            #14
                            Re: What YAML engine do you use?

                            On Fri, 21 Jan 2005 12:04:10 -0600, "A.M. Kuchling" <amk@amk.ca> wrote:
                            [color=blue]
                            >On Fri, 21 Jan 2005 18:30:47 +0100,
                            > rm <rm@rm.net> wrote:[color=green]
                            >> Nowadays, people are trying to create binary XML, XML databases,
                            >> graphics in XML (btw, I'm quite impressed by SVG), you have XSLT, you
                            >> have XSL-FO, ... .[/color]
                            >
                            >Which is an argument in favor of XML -- it's where the activity is, so it's
                            >quite likely you'll encounter the need to know XML. Few projects use YAML,
                            >so the chance of having to know its syntactic details is small.
                            >[/color]
                            <rant>
                            I thought XML was a good idea, but IMO requiring quotes around
                            even integer attribute values was an unfortunate decision. I don't buy
                            their rationale of keeping parsing simple -- as if extracting a string
                            with no embedded space from between an equal sign and terminating white
                            space were that much harder than extracting the same delimited by double quotes.
                            The result is cluttering SVG with needless cruft around numerical graphics parameters.
                            </rant>

                            OTOH, I think the HTML XML spec is very readable, and nicely designed.
                            At least the version 1.0 spec I snagged from W3C a long time ago.
                            .... I see the third edition at http://www.w3.org/TR/REC-xml/ is differently styled,
                            (I guess new style sheets) but still pretty readable (glancing at it now).

                            Regards,
                            Bengt Richter

                            Comment

                            • Peter Hansen

                              #15
                              Re: What YAML engine do you use?

                              A.M. Kuchling wrote:[color=blue]
                              > On Fri, 21 Jan 2005 18:54:50 +0100,
                              > Fredrik Lundh <fredrik@python ware.com> wrote:[color=green]
                              >>judging from http://yaml.org/spec/current.html (750k), the YAML designers are
                              >>clearly insane. that's the most absurd software specification I've ever seen. they
                              >>need help, not users.[/color]
                              >
                              > IMHO that's a bit extreme. Specifications are written to be detailed, so
                              > consequently they're torture to read. Seen the ReStructured Text spec
                              > lately?[/color]
                              [...][color=blue]
                              > But YAML ... the format is now ... not really simpler than
                              > XML and in some ways weaker (e.g. only two encodings supported, more
                              > complicated escaping rules).[/color]

                              As I recall, one of the key original goals for XML was that the
                              parsers be relatively easy to write (relative to SGML).

                              Judging by that YAML spec, I can imagine that a YAML parser could
                              well be much more difficult to write than an XML parser would be.

                              Anyone have personal experience with this?

                              (Yes, I know people don't write parsers as often as they use
                              them, and that's probably some of the justification behind YAML,
                              but looking at that YAML spec, I find it hard to imagine I could
                              ever remember enough of it to write a YAML file by hand, and
                              yet I can and do write XML files by hand often.)

                              -Peter

                              Comment

                              Working...