Maumagnaguagno / Ichor

:drop_of_blood: Fast S-expression parser for Ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ichor Actions Status

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.

Build

cd Ichor
ruby extconf.rb
make

Usage

require_relative 'ichor'
p '(define example (begin () end))'.to_sexpr
ruby -r ./ichor.so -e "p '(+ 2 3)'.to_sexpr"

About

:drop_of_blood: Fast S-expression parser for Ruby


Languages

Language:C 52.8%Language:Ruby 47.2%