[feature request] zero cost, zero sized default config types?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 265
- Avg merge
- 2h 42m
- Merged PRs (30d)
- 4
Description
I'm not sure whether this is compatible with the way you do things, but I've found myself in need of zero cost config types in the course of making somewhat complex data structures, there are lots of little variables that need to be tweaked and tuned and experimented with at runtime, but ultimately will end up being constant in most applications. It turns out that Rust can support that really elegantly with zero-sized types: https://github.com/makoConstruct/vec-with-gaps/blob/main/src/lib.rs#L243 and the stdlib has started doing a similar thing with allocators.
I'm thinking about writing codegen for doing these, so I went looking to see if anyone else was already doing it. It doesn't seem like you're doing that kind of thing? (with the Loosely Typed stuff?) But I thought I should ask you, in case there's some route to compatability I can't see or in case you know of another project doing something closer to this.
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
The issue names no config-rs files or tests; it points instead to src/lib.rs around line 243 in vec-with-gaps and mentions existing “Loosely Typed” support. Start by reviewing that support and the linked Rust zero-sized-type example. The desired API, implementation scope, and completion criteria still need agreement before work can be considered done.
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