DEV Community

Ryan Westlund
Ryan Westlund

Posted on

My first FFI contribution!

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)