magicblock-labs / magicblock-labs/bolt
[Feature] Change execute signature
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 64
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
What if we could express this
```rust
#[system]
pub mod game_loop {
pub fn execute(ctx: Context, delta_time: f32) -> Result {
Ok(ctx.accounts)
}
#[system_input]
pub struct Components {
pub game_state: GameState,
}
}
```
as
```rust
#[system]
impl System for GameLoop {
fn execute(&self, game_state: &mut GameState, delta_time: f32) -> Result<()> {
let in_case_we_need_to_access_context = self.context();
Ok(())
}
}
```
This would make the code more Rusty and we could also benefit from having the ability to define mutability.
Important note:
`Components` are always borrowed
System `Arguments` are always moved
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 tracing the existing #[system] and #[system_input] handling described in the issue. Define how impl System with execute arguments should support borrowed Components, mutable references, moved arguments, and context access; the change is done when the proposed GameLoop form can express those semantics consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100