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

Running as C library #958

Open
Tracked by #777
Menduist opened this issue Oct 10, 2023 · 1 comment
Open
Tracked by #777

Running as C library #958

Menduist opened this issue Oct 10, 2023 · 1 comment

Comments

@Menduist
Copy link
Contributor

Menduist commented Oct 10, 2023

One of Nim strength is C compatibility, and with C compatibility comes compatibility with most other languages through FFI

It would be great to create a C library out of nim-libp2p, which can then be used from other languages (ie python, which is missing a libp2p implementation)

I see 2 alternatives to do so:

Macro based
For instance genny. This project is used to generate python & other wrappers automatically, for instance pixie-python.
However, genny lacks multiple features, and it's not clear how async integration should be done

Manually
For instance, libwaku (examples in various languages: link)

@Menduist Menduist mentioned this issue Oct 10, 2023
21 tasks
@mratsim
Copy link
Contributor

mratsim commented Oct 10, 2023

For async, you might want to have all the procedures that return a future handle use an Async suffix, and you expose wait_mytype(future_mytype* handle).

This is how Nvidia does it for async Cuda procedures.

@kaiserd kaiserd moved this to new in nim-libp2p May 2, 2024
@kaiserd kaiserd moved this from new to icebox in nim-libp2p May 3, 2024
@kaiserd kaiserd moved this from icebox to backlog in nim-libp2p Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: backlog
Development

No branches or pull requests

2 participants