From: Brian I. <in...@tt...> - 2003-03-10 18:44:52
|
Why, This looks pretty awesome. I'm in the middle of rewriting YAML.pm into a multi-layered implementation, that could make use of a C library easily. I'm gonna look at your API. Cheers, Brian On 05/03/03 10:48 -0700, why the lucky stiff wrote: > I'd like to formally announce to the list my work on Syck. > > Syck is a YAML parser written in C with the sole purpose of importing symbols > into a scripting language's symbol table. I had the idea while I was ill and > started work on it about a week ago late one night. Syck is the Speedy YAML > Cobble-Yourself-Together-a-Parser Kit. > > The parser simply builds SyckNodes. The parser passes these nodes to a > handler function, designated in the wrapper code. The handler returns a > SYMID (an unsigned long), which references an entry in the language's symbol > table. > > In Ruby, the SYMID is identical to the VALUE id used internally. In Python > and PHP (which I have extensions for), Syck uses a temporary symbol table > which links SYMIDs to PyObject pointers or PHP's zval pointers. I imagine > Perl would have SV pointers. > > I didn't want to announce this until I was sort of far along. Well, in the > last week I've been able to implement inlines, anchors, aliases, and transfer > methods. I haven't yet started parsing indentation. I have working > extensions in PHP, Perl and Ruby. I am to a point where the proof-of-concept > has been proven and I can finish fleshing it out and release a stable version > soon. > > This work is not meant to compete with libyaml. Libyaml is just too big of a > project for me to dig my claws into. I've tried looking at the code, but > it's currently in an unbuildable state and I'm not sure where Neil left off. > > Plus, the idea behind Syck is to keep it all small footprint. As SyckNodes > are handled by the scripting language, the nodes are freed. The strings and > pointers that comprised the node become housed by the scripting language. > It's bloody fast, I'm telling you. > > At any rate, it's all checked into Sourceforge CVS. See `yaml4r' project, > `syck' module. If you want to give it a whirl here's some basic INSTALL: > > cvs co syck > cd syck > sh bootstrap > ./configure > make > make check > sudo make install > > You don't need to have syck installed to install the Ruby module, but it does > have to be `make'd. Since the syck Ruby module uses Ruby's own symbol table > directly, the `extconf.rb' script copies only the pertinent source files and > build the module from that: > > cd syck/ext/ruby > ruby extconf.rb > make > sudo make install > > Python requires libsyck installed: > > cd syck/ext/python > python setup.py build > sudo python setup.py install > > PHP requires libsyck installed: > > (requires commandline PHP installed) > cd syck/ext/php > sh make_module.sh > sudo make install > > Each of these extensions only has the `load' method. You can find examples on > my weblog. > > _why > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger > for complex code. Debugging C/C++ programs can leave you feeling lost and > disoriented. TotalView can help you find your way. Available on major UNIX > and Linux platforms. Try it free. www.etnus.com > _______________________________________________ > Yaml-core mailing list > Yam...@li... > https://lists.sourceforge.net/lists/listinfo/yaml-core |