Skip to content

Commit 2fcbc2a

Browse files
authored
Merge pull request #325 from waku-org/suggest-new-nim-ffi
Add nim-ffi suggestion
2 parents b12c867 + 38637dc commit 2fcbc2a

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-1
lines changed

FURPS/application/nim_ffi.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Nim-FFI FURPS
2+
3+
## Functionality
4+
5+
1. Provides the core logic needed to expose any synchronous or asynchronous Nim library to a C-FFI library.
6+
7+
## Usability
8+
9+
1. Introduce new pragma definitions, such as `{.ffi.}`, to appropriately annotate types and procedures.
10+
2. Any Nim project can use it and can be installed using Nimble,
11+
similarly to how nim-chronos is imported.
12+
3. The interaction with the exposed C library can be done using JSON.
13+
4. The interaction with the exposed C library can be done using protobuf.
14+
15+
## Reliability
16+
17+
1. Nim-FFI does not leak memory.
18+
2. The exposed C library never hangs when working asynchronously.
19+
20+
## Performance
21+
22+
## Supportability
23+
24+
1. The exposed C library can be used in Golang.
25+
2. The exposed C library can be used in Rust.
26+
3. The exposed C library can be used in Python.
27+
28+
## + (Privacy, Anonymity, Deployments)
29+
30+
1. `nwaku` repository uses `nim-ffi` to expose the existing `libwaku` functionality.
31+

draft-roadmap/nim_usage_improvements.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**Estimated date of completion**: 19 Dec
44

55
**Resources Required for 2025H2**:
6-
- 1 nwaku eng for 2 months
6+
- 2 nwaku eng for 3 months
77
- Support from Vac/Nim team
88

99
Improve usage of Nim related tooling and design patterns by proceedings with PoCs to discover potential gains and caveats.
@@ -69,6 +69,38 @@ Note: maybe taken over by Vac-Nim
6969

7070
- U7. When wrapping the C API, a protobuf definition can be used to generate native types for the host language (PoC).
7171

72+
**Checklist**:
73+
- [ ] Specs: link to specs and/or API definition
74+
- [ ] Code: link to GitHub issues/PRs/Epic
75+
- [ ] Dogfood: link to dogfooding session/artefact
76+
- [ ] Docs: links to README.md or docs.waku.org (TBD)
77+
78+
79+
### Create nim-ffi, a library to easily exposes c-bindings from Nim
80+
81+
**Owner**: nwaku
82+
83+
**Feature**: [Nim FFI](/FURPS/application/nim_ffi.md)
84+
85+
**FURPS**:
86+
87+
- F1. Provides the core logic needed to expose any synchronous or asynchronous Nim library to a C-FFI library.
88+
89+
- U1. Introduce new pragma definitions, such as `{.ffi.}`, to appropriately annotate types and procedures.
90+
- U2. Any Nim project can use it and can be installed using Nimble,
91+
similarly to how nim-chronos is imported.
92+
- U3. The interaction with the exposed C library can be done using JSON.
93+
- U4. The interaction with the exposed C library can be done using protobuf.
94+
95+
- R1. Nim-FFI does not leak memory.
96+
- R2. The exposed C library never hangs when working asynchronously.
97+
98+
- S1. The exposed C library can be used in Golang.
99+
- S2. The exposed C library can be used in Rust.
100+
- S3. The exposed C library can be used in Python.
101+
102+
- +1. `nwaku` repository uses `nim-ffi` to expose the existing `libwaku` functionality.
103+
72104
**Checklist**:
73105
- [ ] Specs: link to specs and/or API definition
74106
- [ ] Code: link to GitHub issues/PRs/Epic

0 commit comments

Comments
 (0)