3 ms·
I recently became Scheme-curious... I'm not particularly interested in a web framework at the moment but I am interested in the process of making Scheme bindin
by anentropic 6y ago
I recently became Scheme-curious...
I'm not particularly interested in a web framework at the moment but I am interested in the process of making Scheme bindings for C libraries
Clearly it's fairly straightforward, at least for libs with small interfaces https://github.com/Mathieu-Desrochers/Schemings/blob/master/sources/foreign-interfaces/b64.scm https://github.com/Mathieu-Desrochers/Schemings/blob/master/...
I've never used them directly but I know in Python there are libraries which can (partially?) automate the process of generating bindings, e.g. https://pythonhosted.org/PyBindGen/tutorial.html#header-file-scanning https://pythonhosted.org/PyBindGen/tutorial.html#header-file... ...it seems like this would be useful for libraries with a large API surface
Is anyone aware of such a tool in any of the Schemes?
- anentropic 6y agoLet me google that for myself... There is SWIG http://www.swig.org/Doc1.3/SWIG.html http://www.swig.org/Doc1.3/SWIG.html which can auto generate bindings from a .h header file (though they recommend manually writing interface files instead of blindly binding everything) and SWIG has output templates for Chicken and Guile Schemes http://www.swig.org/Doc1.3/Chicken.html http://www.swig.org/Doc1.3/Chicken.html http://www.swig.org/Doc1.3/Guile.html http://www.swig.org/Doc1.3/Guile.html Is this the best way to go? Other tools?