a c++ library extract from xicilion's fibjs