Skip to content
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

Merged
merged 3 commits into from
Aug 6, 2020
Merged

Update docs #47

merged 3 commits into from
Aug 6, 2020

Conversation

mickel8
Copy link
Member

@mickel8 mickel8 commented Jul 31, 2020

fix #46

Comment on lines 78 to 84
```elixir
module Example

interface [NIF, CNode]

spec foo() :: {:ok :: label, answer :: int}
```
Copy link
Member Author

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.

Copy link
Member

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

Comment on lines 146 to 149
10:56:38.259 [info] Protocol 'inet_tcp': register/listen error: econnrefused


10:56:38.259 [info] Trying to start epmd...
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be returned?

Copy link
Member

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

@mickel8 mickel8 requested a review from mat-hek August 3, 2020 09:21
@mickel8 mickel8 self-assigned this Aug 3, 2020
@mickel8 mickel8 force-pushed the update-docs branch 4 times, most recently from e055e2b to 1269399 Compare August 4, 2020 09:36
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 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.

Comment on lines 90 to 94
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).
Copy link
Member

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

## 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
Copy link
Member

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

Comment on lines 3 to 5
## 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## 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.

@mickel8 mickel8 requested a review from mat-hek August 6, 2020 08:30
@mickel8 mickel8 merged commit 8ef6953 into master Aug 6, 2020
@mickel8 mickel8 deleted the update-docs branch August 6, 2020 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update guide
2 participants