2025-06-09 19:33:36 +10:00
# Upgrade Nim Usage
2025-06-06 17:20:55 +10:00
2025-06-11 15:24:04 +10:00
**Estimated date of completion**: 19 Dec
2025-06-06 17:20:55 +10:00
**Resources Required for 2025H2**:
2025-07-14 14:34:51 +02:00
- 2 nwaku eng for 3 months
2025-06-11 15:24:04 +10:00
- Support from Vac/Nim team
2025-06-06 17:20:55 +10:00
2025-06-09 19:33:36 +10:00
Improve usage of Nim related tooling and design patterns by proceedings with PoCs to discover potential gains and caveats.
2025-06-10 21:46:03 +10:00
This includes adoption of Nimble, dogfooding VSCode plugin and iteration on C-Binding methodology.
2025-06-06 17:20:55 +10:00
2025-06-10 15:37:18 +10:00
## Strategic Objective
2025-06-11 15:24:04 +10:00
Logos Movement Community Enabling: Dev Journey
2025-06-10 15:37:18 +10:00
## FURPS
2025-06-11 15:34:01 +10:00
See deliverables.
2025-06-10 15:37:18 +10:00
## Risks
2025-06-06 17:20:55 +10:00
2025-06-10 15:37:18 +10:00
| Risk | (Accept, Own, Mitigation) |
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Maturity of tooling | This milestone focusing on trying out fresh Nim tooling, hence it may not be possible to output a PoC, but instead raising a series of upstream issues. |
| Actual value/impact | The direct value on dev ex is not always clear, especially for Nimble. There is hope on bette contributor experience, but the end impact may mostly be on improving Nim tooling by providing constructive feedback. |
2025-06-06 17:20:55 +10:00
2025-06-10 15:37:18 +10:00
## Deliverables
2025-06-06 17:20:55 +10:00
2025-06-10 15:37:18 +10:00
### Migrate nwaku to Nimble PoC
2025-06-06 17:20:55 +10:00
2025-06-10 21:46:03 +10:00
Note: maybe taken over by Vac-Nim
2025-06-06 17:20:55 +10:00
**Owner**: nwaku
2025-06-11 15:34:01 +10:00
**Feature**: [nwaku ](/FURPS/application/nwaku.md )
2025-06-06 17:20:55 +10:00
**FURPS**:
2025-06-11 15:34:01 +10:00
- U1. Uses nimble for package management and build.
- U2. Can be imported as a nim library using nimble.
2025-06-06 17:20:55 +10:00
**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)
2025-06-10 21:46:03 +10:00
### Dogfood VSCode Plugin and Nimsuggest
**Owner**: nwaku
**No FURPS**
2025-06-10 22:36:18 +10:00
**Depends on Migrate nwaku to Nimble PoC**
2025-06-10 21:46:03 +10:00
**Output**:
- [ ] Test nimsuggest in the nwaku codebase
- [ ] Create reproducible setup for crashes and poor performance, open upstream issues.
- [ ] Optional: provide a plan to make nwaku better compatible with nimsuggest (eg. no git submodule, less macros, etc)
2025-06-11 15:24:04 +10:00
### Streamline FFI API Creation by using Protobuf types instead of JSON PoC
2025-06-06 17:20:55 +10:00
**Owner**: nwaku
2025-06-13 00:12:03 +10:00
**Feature**: [Waku SDK ](/FURPS/core/waku_sdk.md )
2025-06-06 17:20:55 +10:00
**FURPS**:
2025-06-12 15:37:21 +10:00
- F8. When wrapping the C API, conversion from native types to Protobuf is needed by the wrapper (PoC).
2025-06-11 15:24:04 +10:00
2025-06-12 15:37:21 +10:00
- U7. When wrapping the C API, a protobuf definition can be used to generate native types for the host language (PoC).
2025-06-06 17:20:55 +10:00
**Checklist**:
- [ ] Specs: link to specs and/or API definition
- [ ] Code: link to GitHub issues/PRs/Epic
- [ ] Dogfood: link to dogfooding session/artefact
2025-07-14 14:34:51 +02:00
- [ ] Docs: links to README.md or docs.waku.org (TBD)
2025-08-04 15:53:39 +10:00
### Create nim-ffi, a library to easily exposes c-bindings from Nim
2025-07-14 14:34:51 +02:00
**Owner**: nwaku
2025-08-04 15:53:39 +10:00
**Feature**: [Nim FFI ](/FURPS/application/nim_ffi.md )
2025-07-22 15:28:19 +10:00
**FURPS**:
2025-07-14 14:34:51 +02:00
2025-08-04 15:53:39 +10:00
- 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.
2025-07-25 11:04:50 +02:00
- +1. `nwaku` repository uses `nim-ffi` to expose the existing `libwaku` functionality.
2025-07-22 15:28:19 +10:00
**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)