
Show HN: How I used Chicken Scheme to build registromat.com - mdesroch02
https://github.com/Mathieu-Desrochers/Schemings
======
anentropic
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/...](https://github.com/Mathieu-
Desrochers/Schemings/blob/master/sources/foreign-interfaces/b64.scm)

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...](https://pythonhosted.org/PyBindGen/tutorial.html#header-file-
scanning) ...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
Let 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?

------
gus_massa
I had to read it a few times to understand what it is. It is something like
"Chicken Scheme+Batteries"? You wrote the wrappers for the libraries and the
autoinstaler?

------
minerjoe
Bravo. FFI for the win.

