pc2 / pc2/sus-compiler

Warn when a `state` variable is possibly read after possibly being written

Open
#65 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
126
Forks
6
PR merge metrics
No merged PRs in 30d

Description

To avoid the confusion between the blocking non-behavior of state, and the blocking behavior on non-state, we should just forbid reading from a state wire lexically after writing to it.

So

state int x
x = 5
int b = x // Warning on this line, because x hasn't been updated yet

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

No implementation file or test is named in the issue. Start by locating the compiler's handling of state wires and lexical reads and writes, then trace how warnings are emitted. Add coverage for the shown state int x example and verify that reading x after x = 5 produces a warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.