Erlang Port Template. Where?

Hello all!

Seeking template for developing Erlang Port application with C++.
Is there any function to create it with Rebar3 or any other solution?
Is the any kind of default template that could be downloaded?

1 Like

The Interoperability Tutorial has an example, maybe that is a good start?

1 Like

I have also studied and learned this before, and I have collected and organized some materials here: https://github.com/ErlGameWorld/eUtils/tree/master/c_src and I have modified the Nif/Port compiler tool so that it can support multiple Nif/Port files in a single project. look at this:GitHub - ErlGameWorld/eNpc: Erlang Nif or port_driver generic compilation scripts for Windows Linux Mac

2 Likes

When you say “Erlang Port application”, do you mean a Port or a Port Driver? The latter is faster but at the same time, like NIFs, also pretty risky:

As a port driver is dynamically linked into the emulator process, this is the fastest way of calling C-code from Erlang. Calling functions in the port driver requires no context switches. But it is also the least safe way, because a crash in the port driver brings the emulator down too.

2 Likes

Btw @alexandr… I think it would be good if you could make your thread titles a little more elaborate :stuck_out_tongue_winking_eye: Like, “Are there any… ?” or “Where can I find… ?” :hugs:

4 Likes