The DyNet library now provides a C API. Using this should be more in line with the foreign function interface provided by Racket.