I wanted to play a bit with cgo. As a project I tried to have Go bindings to snowball.
One of the problems was that snowball does not come as a library but an archive of sources. cgo can handle C source files, but all in the same directory. I had to "flatten" the source tree, rewriting #include directives (sed FTW!).
One the above was done, the rest was pretty much straightforward. I confess that at the beginning I wanted to write a lot of C helper functions, but managed to resist the temptation :)
You can get it with go get bitbucket.org/tebeka/snowball. Note the building takes time - that's C compilation for you :)
No comments:
Post a Comment