DEV Community

loading...

My first FFI contribution!

Ryan Westlund
I'm a programmer, writer, and philosopher. My Github account is yujiri8; all my content besides code is at yujiri.xyz.
・1 min read

I just got this PR merged!

Enable REGEXP by connecting Crystal's stdlib Regex #62

For #61.

Phew! This took me a long time to figure out. I've never worked with Crystal's FFI before. Ideally this should expose the create_function interface fully, but I hope to get feedback on the code before I try to take it farther. I can add tests tomorrow.

This was my first time working with FFI for real. And boy did it take me a long time to figure out, but I'm proud!

The motivation for this PR started with my interest in switching from Postgres to SQLite, and the development of Didact in Crystal. I needed regular expressions to replicate my conlang word search page. Now that it's done... this might be the part where I ditch Postgres. I would love to since Didact needs to be easy to install to meet its purpose and Postgres damages that goal with its distribution-dependent setup and configuration files and yada yada.

Discussion (0)