| 1 | released: { name: Syck, version: 0.60 } |
|---|
| 2 | for: [ Ruby, PHP, Python ] |
|---|
| 3 | by: why the lucky stiff |
|---|
| 4 | about: > |
|---|
| 5 | |
|---|
| 6 | Syck is a YAML parser, an extension for scripting |
|---|
| 7 | languages, written in C. |
|---|
| 8 | |
|---|
| 9 | So what is YAML? YAML is a new language for data. |
|---|
| 10 | Describe objects in plain text. Load the data into |
|---|
| 11 | your scripting language as arrays, dictionaries, |
|---|
| 12 | classes, or primitives. |
|---|
| 13 | |
|---|
| 14 | links: |
|---|
| 15 | YAML: http://www.yaml.org/ |
|---|
| 16 | YAML Cookbook: http://yaml4r.sf.net/cookbook/ |
|---|
| 17 | YAML Type Repository: http://yaml.org/type/ |
|---|
| 18 | YAML Specification: http://yaml.org/spec/ |
|---|
| 19 | Syck: http://www.whytheluckystiff.net/syck/ |
|---|
| 20 | Syck Benchmarks: http://www.whytheluckystiff.net/arch/2003/03/19 |
|---|
| 21 | |
|---|
| 22 | status: > |
|---|
| 23 | |
|---|
| 24 | Syck is about 95% compliant with the YAML spec. Largely, small |
|---|
| 25 | issues remain. |
|---|
| 26 | |
|---|
| 27 | The extensions are quite usable. Ruby, PHP and Python |
|---|
| 28 | can load from a string containing YAML. |
|---|
| 29 | |
|---|
| 30 | Ruby has support for stream loading, type handling, YPath, Okay. |
|---|
| 31 | This release includes an amount of Ruby code comprising the 0.60 |
|---|
| 32 | release of YAML.rb. |
|---|
| 33 | |
|---|
| 34 | benchmarks: > |
|---|
| 35 | |
|---|
| 36 | Syck is quite speedy, although not as swift as most language's |
|---|
| 37 | native serialization. |
|---|
| 38 | |
|---|
| 39 | Syck runs at about: |
|---|
| 40 | |
|---|
| 41 | 50-60% of the speed of Ruby's Marshal. |
|---|
| 42 | 65-90% of the speed of PHP's deserialize(). |
|---|
| 43 | 600% of the speed of Python's Pickle. |
|---|
| 44 | 50-60% of the speed of Python's cPickle. |
|---|
| 45 | |
|---|
| 46 | (Based on various types of structured data.) |
|---|
| 47 | |
|---|
| 48 | installation: > |
|---|
| 49 | |
|---|
| 50 | Syck contains working extensions for the Ruby, PHP, and Python |
|---|
| 51 | languages. Each requires compilation of the libsyck library, |
|---|
| 52 | followed by compilation of the extension. |
|---|
| 53 | |
|---|
| 54 | To compile libsyck, first download libsyck. |
|---|
| 55 | |
|---|
| 56 | tar xzvf syck-0.60.tar.gz |
|---|
| 57 | cd syck-0.60 |
|---|
| 58 | ./configure |
|---|
| 59 | make |
|---|
| 60 | sudo make install |
|---|
| 61 | |
|---|
| 62 | To install the Ruby extension: |
|---|
| 63 | |
|---|
| 64 | cd ext/ruby |
|---|
| 65 | ruby install.rb config |
|---|
| 66 | ruby install.rb setup |
|---|
| 67 | sudo ruby install.rb install |
|---|
| 68 | |
|---|
| 69 | To install the Python extension: |
|---|
| 70 | |
|---|
| 71 | cd ext/python |
|---|
| 72 | python setup.py build |
|---|
| 73 | sudo python setup.py install |
|---|
| 74 | |
|---|
| 75 | To install the PHP extension: |
|---|
| 76 | |
|---|
| 77 | sh make_module.sh |
|---|
| 78 | sudo make install (if you weren't root during make_module.sh) |
|---|
| 79 | php -q syck.php |
|---|
| 80 | |
|---|
| 81 | examples: |
|---|
| 82 | |
|---|
| 83 | To load this document in Ruby: | |
|---|
| 84 | |
|---|
| 85 | ($:~)$ irb |
|---|
| 86 | >> require 'yaml' |
|---|
| 87 | => true |
|---|
| 88 | >> YAML::load( File.open( 'RELEASE' ) ) |
|---|
| 89 | => {"status"=>"Syck is about 60% compliant ..."} |
|---|
| 90 | |
|---|
| 91 | To load this document in PHP: | |
|---|
| 92 | |
|---|
| 93 | ($:~)$ php -a |
|---|
| 94 | Interactive mode enabled |
|---|
| 95 | |
|---|
| 96 | <? dl( 'syck.so' ); print_r( syck_load( implode( '', file( 'RELEASE' ) ) ) ); ?> |
|---|
| 97 | |
|---|
| 98 | .. php then outputs .. |
|---|
| 99 | |
|---|
| 100 | X-Powered-By: PHP/4.2.3 |
|---|
| 101 | Content-type: text/html |
|---|
| 102 | |
|---|
| 103 | Array |
|---|
| 104 | ( |
|---|
| 105 | [released] => Array |
|---|
| 106 | ( |
|---|
| 107 | [name] => Syck |
|---|
| 108 | [version] => 0.60 |
|---|
| 109 | ) |
|---|
| 110 | |
|---|
| 111 | .. and so on .. |
|---|
| 112 | |
|---|
| 113 | To load this document in Python: | |
|---|
| 114 | |
|---|
| 115 | ($:~)$ python |
|---|
| 116 | Python 2.1.3 (#1, Jul 11 2002, 17:52:24) |
|---|
| 117 | [GCC 2.95.3 20010315 (release) [FreeBSD]] on freebsd4 |
|---|
| 118 | Type "copyright", "credits" or "license" for more information. |
|---|
| 119 | >>> import syck |
|---|
| 120 | >>> f = open( 'RELEASE' ) |
|---|
| 121 | >>> syck.load( f.read() ) |
|---|
| 122 | {'by': 'why the lucky stiff', ... } |
|---|
| 123 | |
|---|