rusterlium / rustler

Safe Rust bridge for creating Erlang NIF functions
https://docs.rs/crate/rustler
Apache License 2.0
4.3k stars 224 forks source link

Document use with Erlang #127

Open lpil opened 6 years ago

lpil commented 6 years ago

Hello!

Thanks for this lib.

There is great documentation and examples for use in an Elixir project, but none for an Erlang project. Would it be possible to add this?

Thanks, Louis

scrogson commented 6 years ago

@lpil currently, the rustler_mix project is a mix compiler. There is this issue which asks about rebar3 support.

I think we should definitely provide some guidance about that but haven't taken the time to explore it yet.

OvermindDL1 commented 6 years ago

The elixir -> erlang code should be a direct conversion, what issues are there?

Mix supports full native erlang as well.

scrogson commented 6 years ago

@OvermindDL1 I think the main thing is people who are building a project exclusively with erlang may not want to bring elixir into their project just to compile a rust crate.

lpil commented 6 years ago

Yes, I'd like to avoid adding Elixir to this project :)

DeadZen commented 6 years ago

Any examples yet?

progamer71 commented 6 years ago

My reason is I prefer erlang syntax over elixir syntax.

OvermindDL1 commented 6 years ago

My reason is I prefer erlang syntax over elixir syntax.

Yeah many of us do, Erlang's syntax is just so superior, but Elixir's Macro's and everything they bring in is the main thing that keeps me working in Elixir. ^.^;

russelldb commented 4 years ago

there's a good blog post here https://medium.com/@vonmo/erlang-safe-optimization-with-nif-on-rust-6000b0e9e4bf that covers the basics of running rustler with erlang. I use rustler with erlang so that I can use quviq EQC to test Rust components. I have a few issues (I don't know how to have multiple modules in the same crate for example) but in general it works really well.

I don't have the time right now, but when I do I can write up how to use rustler from erlang

rickpayne commented 4 years ago

I started work on using your rustler_tests from a rebar3 project at https://github.com/rickpayne/rustler_test