-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Difficulty: Medium — Parser, AST, and codegen changes across timer input handling.
Summary
Occam's tim ? AFTER expr construct waits until the timer value exceeds expr. This is used for timed delays and is distinct from tim ? t (which just reads the current time).
Occam syntax
TIMER tim:
INT t:
SEQ
tim ? t -- read current time
tim ? AFTER t PLUS delay -- wait until time passes t + delay
Proposed Go mapping
t = time.Now().UnixMicro()
time.Sleep(time.Duration(t + delay - time.Now().UnixMicro()) * time.Microsecond)Or possibly using AFTER comparison semantics (modular time comparison).
Affected files
bar.occ(lines 176, 189, 225, 373)demo.occ(line 16)sort_inside_2.occ(line 323)
Work required
- Parser: Detect
AFTERkeyword after?in channel/timer input and parse the delay expression - AST: Add an
AfterExprfield (or similar) to the input node - Codegen: Generate
time.Sleep(...)or equivalent
Part of #43.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels