So far my kludgy solution is a mix of C and GLSL, where I can share some header files across the languages for common data structures, with some severe restrictions and terribly ugly macros. I can't share any code, I have to copy and adapt it, so my SDF has to stay in GLSL-land only.

I can actually run my GLSL code on the CPU thanks to llvmpipe, which is cool. But:
- I can't rely on it being available
- I can't debug it with standard tools
- GLSL is very restrictive for general programming