From ebdaa0dfef055e5734130713c94e9b6a53275e29 Mon Sep 17 00:00:00 2001 From: Ivan Folgueira Bande Date: Fri, 25 Jul 2025 11:04:50 +0200 Subject: [PATCH] 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