Re:Elixir 1.5 released
by ch4s3 on Tuesday July 25, 2017 @09:26AM
(#14847521)
Have you written any Rust NIFs? What's the dev experience like?
[ Parent
| on HN ]
Re:Elixir 1.5 released
by plainOldText on Tuesday July 25, 2017 @03:28PM
(#14851092)
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!
Oh cool, that's a great mix find.
Re:Elixir 1.5 released
by OvermindDL1 on Tuesday July 25, 2017 @01:15PM
(#14849663)
With the Rustler Rust library, almost blissfully easy. I highly recommend it.