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