linksplatform / linksplatform/doublets-rs

Improve `ffi::specialize_for`

Open
#11 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

FFI:Attributes
Dominant language
Rust
Stars
6
Forks
0
Avg merge
1h 37m
Merged PRs (30d)
1

Description

Now the specialization for all integer types looks like this:
```rust
#[ffi::specialize_for(
types = "u8",
types = "u16",
types = "u32",
types = "u64",
convention = "rust",
name = "doublets_constants_*"
)]
```
I see two ways of development:

#### 1. Remove `convention` and add explicit annotation with more luxury style:
```rust
#[ffi::specialize_for(
types(
u8 => "u8",
u16 => "uint16",
u32 => "uint",
u64 => "ll",
)
name = "doublets_constants_*"
)]
```
```rust
#[ffi::specialize_for(
u8(u8), u16(uint16), u32(uint), u64(ll),
name = "doublets_constants_*"
)]
```
#### 2. Use a more limited solution with embedded annotations:
```rust
#[ffi::specialize("doublets_constants_*")]
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the current ffi::specialize_for usage and its handling of the convention, types, and name arguments. Compare the two proposed annotation styles and clarify which API should be adopted; done means the chosen specialization syntax is implemented and its existing integer-type use continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.