linksplatform / linksplatform/doublets-rs
No Rust counterpart for Platform.Data.Doublets.Sequences (sequences, Unicode strings, walkers)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6
- Forks
- 0
- Avg merge
- 1h 37m
- Merged PRs (30d)
- 1
Description
## Summary
`Platform.Data.Doublets.Sequences` has no counterpart in `doublets`. A Rust consumer that needs sequences — and therefore strings — has to port the converter/walker stack by hand, while the C# consumer takes a `PackageReference` and is done.
## What is missing
Everything under `Platform.Data.Doublets.Sequences` 0.6.5 that a store-backed string needs:
| C# type | Namespace |
|---|---|
| `BalancedVariantConverter` | `Sequences.Converters` |
| `AddressToRawNumberConverter` | `Sequences.Converters` |
| `RawNumberToAddressConverter` | `Sequences.Converters` |
| `CachingConverterDecorator` | `Sequences.Converters` |
| `CharToUnicodeSymbolConverter` | `Sequences.Unicode` |
| `UnicodeSymbolToCharConverter` | `Sequences.Unicode` |
| `StringToUnicodeSequenceConverter` | `Sequences.Unicode` |
| `UnicodeSequenceToStringConverter` | `Sequences.Unicode` |
| `RightSequenceWalker` | `Sequences.Walkers` |
| `DefaultStack` | `Platform.Collections.Stacks` |
| `TargetMatcher` | `Data.Doublets` |
## Evidence
[link-foundation/link-cli](https://github.com/link-foundation/link-cli) ships the same CLI in C# and in Rust over the same store. The C# half references the package; the Rust half carries a hand-written port of every type above:
- [`rust/src/sequences/`](https://github.com/link-foundation/link-cli/tree/3d53362125be47de595b0cad7a24fe4c3aeefd3d/rust/src/sequences) — 11 modules, ~360 lines, whose module doc reads *"Rust ports of the `Data.Doublets.Sequences` abstractions used by C#"*
- [`rust/src/unicode_string_storage.rs`](https://github.com/link-foundation/link-cli/blob/3d53362125be47de595b0cad7a24fe4c3aeefd3d/rust/src/unicode_string_storage.rs) — ~440 lines assembling them into the C# `UnicodeStringStorage` pipeline
The C# side of the same feature is three `using` lines:
```csharp
using Platform.Data.Doublets.Sequences.Converters;
using Platform.Data.Doublets.Sequences.Walkers;
using Platform.Data.Doublets.Sequences.Unicode;
```
## Why upstream
Storing a string in a links database is not application logic — it is the same balanced-variant encoding for every consumer, and getting it wrong produces a database the C# tooling cannot read. Every Rust consumer that wants strings will otherwise re-derive the same encoding, and they will not agree with each other or with C#.
A `doublets::sequences` module (feature-gated, if the dependency weight is a concern) would let a consumer drop the port entirely.
Reported from link-foundation/link-cli#100, which asks that gaps found while updating to doublets 0.5.0 be filed here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the requested types with the hand-written port in link-cli's rust/src/sequences/ and its assembly in rust/src/unicode_string_storage.rs. Use the listed C# namespaces and the existing Rust port as the compatibility reference. Done means a doublets::sequences module provides the converter, Unicode, walker, stack, and matcher abstractions needed by Rust consumers without reimplementing them, while preserving C# store interoperability.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, rust
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100