Hacker News new | ask | show | jobs
by plainOldText 3253 days ago
Yes, I have. I would say it's pretty easy. Had it not been for rustler I wouldn't have touched NIFs since I'm not a C programmer. Also, rustler supplies elegant building blocks, which makes it a straightforward experience.

I've had a few issues with the version of rustler published on hex.pm not working with Erlang/OTP 20, and I've tried using the master repo as a dependency in my `mix.exs`, but that didn't work since rustler repo has an unusual directory structure which fails to compile. And then lo and behold, I've discovered how amazing the `mix` tool is and via `mix help deps` I've learned that you can actually check out a specific directory (via `sparse` option) from a remote repo as your dependency.

Now my dependency listed in `mix.exs` looks like this:

    {:rustler, ">= 0.0.0", git: "https://github.com/hansihe/rustler.git",
                            tag: "0.15.1", sparse: "rustler_mix"}
... and problem solved. I guess peeking at rustler's tests helped me a lot.

All in all, the entire Elixir ecosystem is really elegant. Such a joy to write code now!

1 comments

Oh cool, that's a great mix find.