-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update docs #47
Update docs #47
Conversation
pages/creating_unifex_natives.md
Outdated
```elixir | ||
module Example | ||
|
||
interface [NIF, CNode] | ||
|
||
spec foo() :: {:ok :: label, answer :: int} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this example is not too simple but on the other hand I linked some more advanced ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add some arguments to foo
pages/creating_unifex_natives.md
Outdated
10:56:38.259 [info] Protocol 'inet_tcp': register/listen error: econnrefused | ||
|
||
|
||
10:56:38.259 [info] Trying to start epmd... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be returned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first message is logged by Erlang stdlib when it can't connect to CNode because empd is not started, so there's no way to disable it. The other is logged by Bundlex. It won't happen if epmd is started, so you can remove that from here. See https://erlang.org/doc/man/epmd.html
e055e2b
to
1269399
Compare
README.md
Outdated
@@ -8,7 +8,7 @@ Unifex is a tool for generating interfaces between native C code and Elixir, tha | |||
- provides intuitive and conscise tools for defining native interfaces, | |||
- generates all the boilerplate for you, | |||
- provides useful abstractions over binaries and state, | |||
- makes native code independent from `erl_nif` library, so once port-based interface is supported, the same code will be usable either with NIFs or ports. | |||
- makes native code independent from `erl_nif` library, so the same code is usable either with NIFs or CNodes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- makes native code independent from `erl_nif` library, so the same code is usable either with NIFs or CNodes. | |
- makes native code independent from [erl_nif](https://erlang.org/doc/man/erl_nif.html) or [ei](https://erlang.org/doc/man/ei.html) library, so the same code is usable either with NIFs or CNodes. |
pages/creating_unifex_natives.md
Outdated
More information on how `.spec.exs` files should be created can be found in docs for | ||
`Unifex.Specs.DSL` module. | ||
You can also check out our [test_projects](https://github.com/membraneframework/unifex/tree/master/test_projects) | ||
to see a little more advanced examples or look how we use Unifex in a our repositories | ||
e.g. in [shmex](https://github.com/membraneframework). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also stated at the end, I think it's enough to have it there
pages/creating_unifex_natives.md
Outdated
## More examples | ||
You can find more complete projects [here](https://github.com/membraneframework/unifex/tree/master/test_projects). | ||
Also check out how we use Unifex in our [repositories](https://github.com/membraneframework) e.g. in | ||
[shmex](https://github.com/membraneframework/shmex) and please refer to `Unifex.Specs.DSL` module's documentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually we don't use unifex in shmex, because unifex uses shmex :P
pages/creating_unifex_natives.md
Outdated
## Introduction | ||
In this section we present how to create Unifex Natives. | ||
We will show it by writing code that will be compiled both as NIF and CNode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Introduction | |
In this section we present how to create Unifex Natives. | |
We will show it by writing code that will be compiled both as NIF and CNode. | |
In this tutorial, you will learn how to use Unifex natives to write native code that can be compiled both as NIF and CNode. |
fix #46