From f0010c9abcd3ea01b6de28386bcbbb0d89e8bf2e Mon Sep 17 00:00:00 2001 From: Ivan Folgueira Bande Date: Mon, 14 Jul 2025 14:34:51 +0200 Subject: [PATCH 1/5] Add nim-ffi suggestion --- draft-roadmap/nim_usage_improvements.md | 26 +++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/draft-roadmap/nim_usage_improvements.md b/draft-roadmap/nim_usage_improvements.md index f864976..ee85c14 100644 --- a/draft-roadmap/nim_usage_improvements.md +++ b/draft-roadmap/nim_usage_improvements.md @@ -3,7 +3,7 @@ **Estimated date of completion**: 19 Dec **Resources Required for 2025H2**: -- 1 nwaku eng for 2 months +- 2 nwaku eng for 3 months - Support from Vac/Nim team Improve usage of Nim related tooling and design patterns by proceedings with PoCs to discover potential gains and caveats. @@ -73,4 +73,26 @@ Note: maybe taken over by Vac-Nim - [ ] Specs: link to specs and/or API definition - [ ] Code: link to GitHub issues/PRs/Epic - [ ] Dogfood: link to dogfooding session/artefact -- [ ] Docs: links to README.md or docs.waku.org (TBD) \ No newline at end of file +- [ ] Docs: links to README.md or docs.waku.org (TBD) + + +### Create new nim-ffi repository that will allow exposing any Nim library in an easy way + +**Owner**: nwaku + +**Feature**: +- [Waku SDK](/FURPS/core/waku_sdk.md) +- [RLN SDK](/FURPS/core/rln_sdk.md) +- [Chat SDK](/FURPS/application/chat_sdk.md) +- [SDS](/FURPS/application/sds.md) + +**No FURPS**: + +**Output**: + - [ ] The `nim-ffi` repository provides the core logic needed to expose any synchronous or asynchronous Nim library. This involves meta-programming and the introduction of new pragma definitions, such as `{.ffi.}`, to appropriately annotate types and procedures. + + - [ ] `nim-ffi` can be installed using Nimble. + + - [ ] The `nwaku` repository uses `nim-ffi` to expose the existing `libwaku` functionality. + + - [ ] All Nim libraries should expose their APIs (functions, types, etc.) through `nim-ffi`. \ No newline at end of file From 3a91c1852d53e6f72ff2a5f2dfb2154e1cb0ce2c Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 22 Jul 2025 15:28:19 +1000 Subject: [PATCH 2/5] clean furps --- FURPS/application/nim_ffi.md | 25 +++++++++++++++++++++++++ draft-roadmap/nim_usage_improvements.md | 24 +++++++++++++----------- 2 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 FURPS/application/nim_ffi.md diff --git a/FURPS/application/nim_ffi.md b/FURPS/application/nim_ffi.md new file mode 100644 index 0000000..4a38819 --- /dev/null +++ b/FURPS/application/nim_ffi.md @@ -0,0 +1,25 @@ +# {Feature Name} FURPS + +## Functionality + +1. Provides the core logic needed to expose any synchronous or asynchronous Nim library to FFI. + +## Usability + +1. Introduce new pragma definitions, such as `{.ffi.}`, to appropriately annotate types and procedures. + +## Reliability + +1. ... + +## Performance + +1. ... + +## Supportability + +1. Can be installed using Nimble. + +## + (Privacy, Anonymity, Deployments) + +1. `nwaku` repository uses `nim-ffi` to expose the existing `libwaku` functionality. diff --git a/draft-roadmap/nim_usage_improvements.md b/draft-roadmap/nim_usage_improvements.md index ee85c14..d36562d 100644 --- a/draft-roadmap/nim_usage_improvements.md +++ b/draft-roadmap/nim_usage_improvements.md @@ -76,23 +76,25 @@ Note: maybe taken over by Vac-Nim - [ ] Docs: links to README.md or docs.waku.org (TBD) -### Create new nim-ffi repository that will allow exposing any Nim library in an easy way +### Create nim-ffi, a library to easily expose c-bindings from Nim **Owner**: nwaku **Feature**: -- [Waku SDK](/FURPS/core/waku_sdk.md) -- [RLN SDK](/FURPS/core/rln_sdk.md) -- [Chat SDK](/FURPS/application/chat_sdk.md) -- [SDS](/FURPS/application/sds.md) +- [Nim FFI](/FURPS/application/nim_ffi.md) -**No FURPS**: +**FURPS**: -**Output**: - - [ ] The `nim-ffi` repository provides the core logic needed to expose any synchronous or asynchronous Nim library. This involves meta-programming and the introduction of new pragma definitions, such as `{.ffi.}`, to appropriately annotate types and procedures. +- F1. Provides the core logic needed to expose any synchronous or asynchronous Nim library to FFI. - - [ ] `nim-ffi` can be installed using Nimble. +- U1. Introduce new pragma definitions, such as `{.ffi.}`, to appropriately annotate types and procedures. - - [ ] The `nwaku` repository uses `nim-ffi` to expose the existing `libwaku` functionality. +- S1. Can be installed using Nimble. - - [ ] All Nim libraries should expose their APIs (functions, types, etc.) through `nim-ffi`. \ No newline at end of file +_ +1. `nwaku` repository uses `nim-ffi` to expose the existing `libwaku` functionality. + +**Checklist**: +- [ ] Specs: link to specs and/or API definition +- [ ] Code: link to GitHub issues/PRs/Epic +- [ ] Dogfood: link to dogfooding session/artefact +- [ ] Docs: links to README.md or docs.waku.org (TBD) \ No newline at end of file From ebdaa0dfef055e5734130713c94e9b6a53275e29 Mon Sep 17 00:00:00 2001 From: Ivan Folgueira Bande Date: Fri, 25 Jul 2025 11:04:50 +0200 Subject: [PATCH 3/5] add some more FURPS to nim-ffi deliverable --- FURPS/application/nim_ffi.md | 14 +++++++++++--- draft-roadmap/nim_usage_improvements.md | 17 ++++++----------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/FURPS/application/nim_ffi.md b/FURPS/application/nim_ffi.md index 4a38819..c030e08 100644 --- a/FURPS/application/nim_ffi.md +++ b/FURPS/application/nim_ffi.md @@ -2,7 +2,10 @@ ## Functionality -1. Provides the core logic needed to expose any synchronous or asynchronous Nim library to FFI. +1. Provides the core logic needed to expose any synchronous or asynchronous Nim library to a C-FFI library. +2. The exposed C library can be used in Golang. +3. The exposed C library can be used in Rust. +4. The exposed C library can be used in Python. ## Usability @@ -10,7 +13,8 @@ ## Reliability -1. ... +1. The exposed C library does not leak memory. +2. The exposed C library never hangs when working asynchronously. ## Performance @@ -18,8 +22,12 @@ ## Supportability -1. Can be installed using Nimble. +1. Any Nim project can use it and can be installed using Nimble, +similarly to how nim-chronos is imported. +2. The interaction with the exposed C library is through JSON. +3. The interaction with the exposed C library is through protobuf. ## + (Privacy, Anonymity, Deployments) 1. `nwaku` repository uses `nim-ffi` to expose the existing `libwaku` functionality. + diff --git a/draft-roadmap/nim_usage_improvements.md b/draft-roadmap/nim_usage_improvements.md index d36562d..73dd00c 100644 --- a/draft-roadmap/nim_usage_improvements.md +++ b/draft-roadmap/nim_usage_improvements.md @@ -76,22 +76,17 @@ Note: maybe taken over by Vac-Nim - [ ] Docs: links to README.md or docs.waku.org (TBD) -### Create nim-ffi, a library to easily expose c-bindings from Nim +### Create nim-ffi, a Nim project to easily exposes c-bindings from Nim **Owner**: nwaku -**Feature**: -- [Nim FFI](/FURPS/application/nim_ffi.md) - **FURPS**: +This deliverable takes care of the following [Nim FFI](/FURPS/application/nim_ffi.md) FURPS: -- F1. Provides the core logic needed to expose any synchronous or asynchronous Nim library to FFI. - -- U1. Introduce new pragma definitions, such as `{.ffi.}`, to appropriately annotate types and procedures. - -- S1. Can be installed using Nimble. - -_ +1. `nwaku` repository uses `nim-ffi` to expose the existing `libwaku` functionality. +- F1. +- U1. +- S1. +- +1. `nwaku` repository uses `nim-ffi` to expose the existing `libwaku` functionality. **Checklist**: - [ ] Specs: link to specs and/or API definition From 3005c54a7e5d232067cc9e9f2b72be7e9a0a3df8 Mon Sep 17 00:00:00 2001 From: Ivan Folgueira Bande Date: Tue, 29 Jul 2025 09:28:39 +0200 Subject: [PATCH 4/5] adjust as per Franck's comments --- FURPS/application/nim_ffi.md | 14 +++++++------- draft-roadmap/nim_usage_improvements.md | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/FURPS/application/nim_ffi.md b/FURPS/application/nim_ffi.md index c030e08..7c8656d 100644 --- a/FURPS/application/nim_ffi.md +++ b/FURPS/application/nim_ffi.md @@ -3,13 +3,14 @@ ## Functionality 1. Provides the core logic needed to expose any synchronous or asynchronous Nim library to a C-FFI library. -2. The exposed C library can be used in Golang. -3. The exposed C library can be used in Rust. -4. The exposed C library can be used in Python. ## Usability 1. Introduce new pragma definitions, such as `{.ffi.}`, to appropriately annotate types and procedures. +2. Any Nim project can use it and can be installed using Nimble, +similarly to how nim-chronos is imported. +3. The interaction with the exposed C library is through JSON. +4. The interaction with the exposed C library is through protobuf. ## Reliability @@ -22,10 +23,9 @@ ## Supportability -1. Any Nim project can use it and can be installed using Nimble, -similarly to how nim-chronos is imported. -2. The interaction with the exposed C library is through JSON. -3. The interaction with the exposed C library is through protobuf. +1. The exposed C library can be used in Golang. +2. The exposed C library can be used in Rust. +3. The exposed C library can be used in Python. ## + (Privacy, Anonymity, Deployments) diff --git a/draft-roadmap/nim_usage_improvements.md b/draft-roadmap/nim_usage_improvements.md index 73dd00c..1f23aab 100644 --- a/draft-roadmap/nim_usage_improvements.md +++ b/draft-roadmap/nim_usage_improvements.md @@ -85,7 +85,7 @@ This deliverable takes care of the following [Nim FFI](/FURPS/application/nim_ff - F1. - U1. -- S1. +- U2. - +1. `nwaku` repository uses `nim-ffi` to expose the existing `libwaku` functionality. **Checklist**: From 38637dcae812359826a21436e58bd98042946258 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Mon, 4 Aug 2025 15:53:39 +1000 Subject: [PATCH 5/5] tidy up --- FURPS/application/nim_ffi.md | 14 ++++++-------- draft-roadmap/nim_usage_improvements.md | 25 +++++++++++++++++++------ 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/FURPS/application/nim_ffi.md b/FURPS/application/nim_ffi.md index 7c8656d..cb865dd 100644 --- a/FURPS/application/nim_ffi.md +++ b/FURPS/application/nim_ffi.md @@ -1,4 +1,4 @@ -# {Feature Name} FURPS +# Nim-FFI FURPS ## Functionality @@ -6,21 +6,19 @@ ## Usability -1. Introduce new pragma definitions, such as `{.ffi.}`, to appropriately annotate types and procedures. +1. Introduce new pragma definitions, such as `{.ffi.}`, to appropriately annotate types and procedures. 2. Any Nim project can use it and can be installed using Nimble, -similarly to how nim-chronos is imported. -3. The interaction with the exposed C library is through JSON. -4. The interaction with the exposed C library is through protobuf. + similarly to how nim-chronos is imported. +3. The interaction with the exposed C library can be done using JSON. +4. The interaction with the exposed C library can be done using protobuf. ## Reliability -1. The exposed C library does not leak memory. +1. Nim-FFI does not leak memory. 2. The exposed C library never hangs when working asynchronously. ## Performance -1. ... - ## Supportability 1. The exposed C library can be used in Golang. diff --git a/draft-roadmap/nim_usage_improvements.md b/draft-roadmap/nim_usage_improvements.md index 1f23aab..7c1dbe4 100644 --- a/draft-roadmap/nim_usage_improvements.md +++ b/draft-roadmap/nim_usage_improvements.md @@ -76,16 +76,29 @@ Note: maybe taken over by Vac-Nim - [ ] Docs: links to README.md or docs.waku.org (TBD) -### Create nim-ffi, a Nim project to easily exposes c-bindings from Nim +### Create nim-ffi, a library to easily exposes c-bindings from Nim **Owner**: nwaku -**FURPS**: -This deliverable takes care of the following [Nim FFI](/FURPS/application/nim_ffi.md) FURPS: +**Feature**: [Nim FFI](/FURPS/application/nim_ffi.md) + +**FURPS**: + +- F1. Provides the core logic needed to expose any synchronous or asynchronous Nim library to a C-FFI library. + +- U1. Introduce new pragma definitions, such as `{.ffi.}`, to appropriately annotate types and procedures. +- U2. Any Nim project can use it and can be installed using Nimble, + similarly to how nim-chronos is imported. +- U3. The interaction with the exposed C library can be done using JSON. +- U4. The interaction with the exposed C library can be done using protobuf. + +- R1. Nim-FFI does not leak memory. +- R2. The exposed C library never hangs when working asynchronously. + +- S1. The exposed C library can be used in Golang. +- S2. The exposed C library can be used in Rust. +- S3. The exposed C library can be used in Python. -- F1. -- U1. -- U2. - +1. `nwaku` repository uses `nim-ffi` to expose the existing `libwaku` functionality. **Checklist**: