JavaScript implementation of HAL format