define-library implementation for Gambit