README.rdoc in sexpistol-0.0.6 vs README.rdoc in sexpistol-0.0.7

- old
+ new

@@ -1,8 +1,8 @@ = Sexpistol -Sexpistol is a simple library for parsing S-Expressions in Ruby. Sexpistol takes an S-Expression and turns it into a native Ruby data structure made up of nested sets of arrays. +Sexpistol is a very fast and easy-to-use library for parsing S-Expressions in Ruby. Sexpistol takes an S-Expression in string form and turns it into a native Ruby data structure made up of nested sets of arrays. === Example (define test (lambda () ( (print "Hello world!\n") @@ -40,10 +40,19 @@ @parser.ruby_keyword_literals = true @parser.parse_string("nil false true") #=> [nil, false, true] +== Scheme compatibility + +Above all Sexpistol strives to be compatible with Scheme-style S-Expressions. This means that Sexpistol supports comma quoting, though quasi-quoting is not yet implemented. Sexpistol can also generate Scheme compatible external representations when the 'scheme_compatability' options is set to true: + + @parser = Sexpistol.new + @parser.scheme_compatability = true + @parser.to_sexp([:test, false, true, nil]) + #=> "(test #f #t ())" + === Installation For convenience Sexpistol is packaged as a RubyGem, to install it simply enter the following at your command line: gem install sexpistol @@ -64,10 +73,17 @@ # Turn the array structure back into an S-Expression @parser.to_sexp( ast ) #=> "( string ( is ( parsed ) ) )" +=== Performance + +The core of Sexpistol was recently re-written using StringScanner and the new version is roughly twice as fast as the older ones. + +Parsing throughput on my test machine (2Ghz Core 2 Duo, 4GB RAM, Ruby 1.9) is approximately 1 Megabytes/sec. This is fairly high given that Sexpistol is pure Ruby. Benchmarking Sexpistol against other popular S-Expression parser gems shows that it is roughly 8x faster than the nearest competitor. + === Author & Credits Author:: {Aaron Gough}[mailto:aaron@aarongough.com] +Contributors:: {Shane Hanna}[http://github.com/shanna] Copyright (c) 2010 {Aaron Gough}[http://thingsaaronmade.com/] ({thingsaaronmade.com}[http://thingsaaronmade.com/]), released under the MIT license \ No newline at end of file