When you're documenting a project so other people can use it, whether it's a library or web service, one important thing to do is to give people good examples to work with. Not only does this save people time trying to cobble together their first working program, but it's also a good way to show how the library is meant to be used, instead of just what's technically possible.
Easy mistakes when writing OCaml C bindings
I recently spent several days improving the OCaml FreeTDS C bindings for work, and I thought it might be useful to share the problems I ran into and how to solve them.
I tried to order things so the most likely issues are listed first, but if you're trying to debug some C binding crashes, I recommend just reading the whole thing.
This post will assume you're already familiar with the official documentation.
How to use Core.Command.Param
Core.Command
(and the closely-related Async.Command
) is an OCaml library for creating command line programs with nice interfaces (including help text and argument parsing). This article is an overview of Command.Param
, the newer interface for defining your command's arguments.
FreeTDS 0.91's TDS 7.1 support is buggy
This is a short post to document an issue we ran into at work so it will show up in search results for people who have this problem in the future.
- Use FreeTDS 1.0 if you can.
- If you're stuck on FreeTDS 0.91 (and possible other pre-1.0 versions), don't use any TDS version above 7.0.
The minimum viable XLSX reader
I recently finished a basic XLSX reader for OCaml and I thought it would be a good time to summarize what's necessary to make a library like this, since the documentation is complicated and sometimes hard to find.
Documentation
If you're planning to read XLSX files, you probably want to …