Improvements to internal ownership semantics
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 337
- Forks
- 32
- Avg merge
- 8d 17h
- Merged PRs (30d)
- 11
Description
-
Get rid of
Console::get_mut(). Use interior mutability on specific fields. Maybe withArkRefCellthat's only panicking in debug builds. -
Some of the channels consumed by the readconsole event loop shouldn't be clonable. ReadConsole is reentrant, and cloning a receiver means only one of the clones gets a message. We currently clone them, but luckily the reentrant path shuts down the event loop beforehand. We should make an unclonable wrapper to enforce the property. https://github.com/posit-dev/ark/blob/74efb5294878454ff3d618debcd4fd528cd6f0b7/crates/ark/src/console/console_repl.rs#L963-L969
Not urgent (Ark is not exploding left and right) but would be nice to converge towards a safer setup.
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 reading Console::get_mut() and the referenced readconsole event-loop code in crates/ark/src/console/console_repl.rs, especially lines 963-969. Trace the fields that need interior mutability and the channels cloned by the reentrant path. Done means ownership is safer: get_mut() is removed, specific fields use the proposed mutability approach, and non-clonable channel usage is enforced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100