Hello comrades.
A new version of YAML.rb is available. See http://yaml4r.sf.net/ to
download the distribution. This release contains fixes from RubyConf,
as well as an updated IO wrapper using StringIO under 1.7 or a
simplified version of MoonWolf’s under 1.6.
I just want to explain the roadmap for YAML.rb briefly. And also the
latest word on the YAML spec.
I am refactoring YAML.rb’s parser. The parser breaks down into four
basic pieces. The IO wrapper, the tokenizer, the preprocessor and the
actual Racc parser. Each of these pieces is being isolated, profiled,
punished and optimized. Each minor release leading up to 0.50 will
include the fresh component.
- 0.47: The IO wrapper class
- 0.48: The tokenizer
- 0.49: The preprocessor
- 0.50: The parser
There are so many approaches to parsing YAML that, in the case of the
tokenizer, I have rewritten it several times, benchmarking each
technique on my P166 laptop (the true test of speed!) against files
ranging from a few kilobytes to files several megabytes in size.
I wanted to make the changes all happen in a single release, but I’d
rather make changes incrementally to give you access to changes quickly
and to give me time to test each piece individually.
···
As for the YAML spec, you can find some dramatic changes to the spec
posted at http://yaml.org/spec/. The spec now focuses on the basic
rationale and structure for YAML. The entire typing mechanism has been
moved into a types repository [http://yaml.org/type/]. This will allow
generic usage of YAML structures without typing.
The typing structure now becomes much more flexible. Previous YAML
specs capitalized on the common data structures found in Ruby, Python
and (to some degree) Perl. In each of these languages, the Hash or
Dictionary is an unordered mapping of unique keys. On the other hand,
PHP has an associative array, which is an ordered mapping of unique keys.
XML has ordered mappings of key-value pairs.
The new !omap, !pairs and !set types accomodate those typing structures
in YAML. The new !merge type also helps to describe inheritance in
data. So while we’ve simplified the YAML specification dramatically,
we’re carefully extending the type repository to accomodate common data
types.
I guess I want to end with thanks to all of Rubyland. So many
supportive blokes. Free banjos for everyone!
_why