NIF for Cython code?

Is it possible to write a NIF for a Cython-based project?

I’ve never written a NIF before.

It looks like pandas has a lot of performance features due to its use of Cython and numpy (which I think is also using Cython). I see that there’s a numpy project for elixir. I’m wondering how hard it would be to wrap pandas with a NIF for elixir.

I see that there’s an elixir dataframe project but this seems abandoned, and I don’t see any indication of how the author plans to recreate the performance benefits. There’s also a dataframe project in rust, which might lend itself to integration with elixir, but this project seems immature and I wonder if it’s smart to reinvent the wheel here.

It is possible but embedding Python and whatever custom bits brought by Cython might be annoying enough for you to consider some alternatives such as using Rust with Rustler?!

1 Like