jeramyRR

jeramyRR

Are there any good tutorials on how to use Rustler?

I’m looking for a good tutorial or documentation on how to use Rustler in a safe way. Everything I’ve found so far uses unwrap everywhere. I’d like to use NitfResult and convert my results into a rustler result, but I’m having a bit of trouble figuring it out.

Rustler’s documentation is basically void of any examples on how to use the library. There’s one example referenced in the docs but that repo is 6 years old and covers very little.

Thanks! :smiley:

Most Liked

dimitarvp

dimitarvp

Your best bet is taking inspiration from various Elixir projects using it, sadly.

In the last few months work on Rustler seems to have resumed so I hope we can expect a stable 0.22 version before the end of the year. This is important because 0.21 had pretty verbosive syntax requirements for the glue code and 0.22-rc introduced a much shorter and readable one.

This GitHub search can help send you in the right direction, hopefully.


EDIT: Interestingly enough (and I stand corrected), Rustler has a 0.22.0 GIT tag (and no GitHub release but that seems irrelevant?). But it does look like Rustler 0.22 is actually official, judging by its hex.pm page.

Qqwy

Qqwy

TypeCheck Core Team

I was able to find this Medium article on getting started with Rustler.

Besides this, I do know that the maintainers are working on an improved page with more general guides next to the already-existing Elixir- and Rust module documentation pages. However, that seems to still be a ways off, unfortunately.

If you have any concrete questions, I’m sure we’ll be able to help you along here at the Elixir Forum. I’ve gone through the rodeo of making a NIF a couple of times now, and there are others who regularly use Rustler as well, so ask any questions you might have :smiley: .

mpope

mpope

Where Next?

Popular in Questions Top

Tee
can someone please explain to me how Enum.reduce works with maps
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
Phillipp
Hey, I have a NanoPi-M3 and try to install Elixir on their Ubuntu image. I followed the Raspberry Pi installation instructions from the ...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New

We're in Beta

About us Mission Statement