Fast S-expression parser extension for Ruby
The goal of this project is to add to Ruby a fast String#to_sexpr
method to parse large symbolic expressions.
Only atoms and lists are considered, quotes, nil and comments are currently out of scope.
Atoms are expected to be encoded in ASCII and separated by whitespaces, characters with value between 1 and 32.
An exception is raised when missing an open/close parentheses or the expression is malformed.
Parsing stops once a NUL is reached.
cd Ichor
ruby extconf.rb
make
require_relative 'ichor'
p '(define example (begin () end))'.to_sexpr
ruby -r ./ichor.so -e "p '(+ 2 3)'.to_sexpr"