Announcing Common Lisp bindings for libcmark

Hello everyone,

I would like to announce a new project: cl-cmark. It’s a Common Lisp system (what we call libraries) which wraps the reference implementation via FFI. There are two systems provided:

  • libcmark exposes low-level 1:1 bindings to the C library
  • cmark exposes a lispy interface using CLOS classes, Lisp functions, and all the other good stuff

The cmark system is what most people will want to use, libcmark is just an escape hatch and people can write their how high-level bindings if they don’t like mine. Implementation-wise cmark is almost completely written in Lisp, the C library is only used for parsing. This means that I had to re-implement all the algorithms, such as tree traversal. I made that choice because it was easier than wrapping node pointers and making sure to avoid dangling pointers if a node is garbage-collected. This comes with a performance penalty because now I first need to parse a document in C, allocate the entire tree, then allocate a new tree in Lisp on to of the first tree, before finally freeing the C tree. Does the difference matter? Probably not.

The project is currently in beta state. Everything has been tested and the most important parts are implemented. It could be used in production right now. Nevertheless, there are some minor but nice to have features missing. There is no documentation either, I want to write it last and give myself some freedom to change the API. Once the documentation is done, that will be the 1.0 release.

I hope someone enjoys this library. Feedback is always welcome.

cl-cmark approaching stable release

In June of this year I introduced my Common Lisp library cl-cmark (GitHub mirror), which implements parsing [CommonMark] documents and manipulating the resulting document tree. I have been hammering out the last kinks over the past weeks and I am now ready to call it done. Before I officially put the 1.0 stamp on it though I would like if a few more people could take a look at the library and give it a try.

I have filed a request (#2230) for inclusion in Quicklisp. Until then you will have to check out the library from source. If you have any suggestions or issues please open an issue on GitLab or GitHub.