It's not officially supported yes but having actually done it multiple times for multiple projects I don't see how it's not straightforward.
- You do the linking yourself, so that you can pass the flags to produce the kind of library you want. This is something the Crystal compiler helps with (it spits out the LDFLAGS that you need).
- Calling `GC.init` when your library is loaded if you want to use garbage collection seems a bit obvious in its necessity. Using `GC.free` to free memory that has gone beyond Crystal boundaries follows naturally (and most libraries have custom `free_*` functions to clean up complex objects).
The main complexity you have to write a C-friendly API for the library, but that's something that you have to do with C++ and so on as well