-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Several advanced KRoC (Kent Retargetable occam Compiler) extensions are not yet supported. These are needed by programs like the mandelbrot demo (kroc/demos/ttygames/mandelbrot.occ, see #39) and likely other KRoC programs that use mobile data, typed channels, and shared-resource synchronization.
Unsupported Constructs
1. DATA TYPE — Named record type alias
DATA TYPE COMPLEX64
RECORD
REAL64 real, imag:
:
2. CHAN TYPE — Channel type definitions with mobile record payloads
CHAN TYPE CT.WORK.IN
MOBILE RECORD
CHAN INT notify?:
CHAN P.JOB.IN in!:
:
3. INLINE FUNCTION — Inline modifier on function declarations
REAL64 INLINE FUNCTION COMPLEX64ABSSQ (VAL COMPLEX64 x) IS
(x[real]*x[real]) + (x[imag]*x[imag]):
4. SHARED parameter qualifier — Shared channel ownership
PROC worker (SHARED CT.WORK.IN! link.in, SHARED CT.WORK.OUT! link.out)
5. MOBILE constructor — Creating mobile channel type instances
mwsvr.in, mwcli.in := MOBILE CT.WORK.IN
6. CLAIM block — Mutual exclusion for shared channel access
CLAIM link.in
link.in[in] ? frame; jobid; job
Notes
These are all KRoC-specific extensions beyond base occam for mobile data, typed channels, and shared-resource synchronization. Each would require new lexer tokens, AST nodes, parser rules, and codegen support.
Suggested implementation priority (simplest first):
- INLINE FUNCTION — Modify FuncDecl parsing to accept and ignore the INLINE keyword
- DATA TYPE — New TypeAlias AST node and record body parsing
- SHARED qualifier — Add to parameter parsing for channels
- CLAIM block — New statement type for synchronization (could map to
sync.Mutex) - CHAN TYPE / MOBILE — Most complex; requires new type definitions and constructor expressions
Related: #39
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels