Enable running course module programs end-to-end#28
Merged
associate-1 merged 1 commit intomainfrom Feb 20, 2026
Merged
Conversation
Convert occam string escape sequences (*c, *n, *t, *s, **, *', *") to real bytes in the parser, and generate a main() harness for PROCs with the standard entry point signature (CHAN BYTE keyboard?, screen!, error!) that wires stdin/stdout/stderr to byte channels. Programs using the KRoC course module can now be transpiled, compiled, and run. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dboreham
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
*c,*n,*t,*s,**,*',*") are now converted to real bytes in the parser, so"Hello World*c*n"produces correct Go output ("Hello World\r\n")(CHAN BYTE keyboard?, screen!, error!)automatically get a generatedfunc main()that wires stdin/stdout/stderr to byte channels via buffered I/O goroutinesexamples/course_hello.occand updated README with a walkthrough for transpiling and running programs that use the KRoC course moduleTest plan
go test ./parser -run TestStringEscape— parser converts all occam escape sequences correctlygo test ./codegen -run TestStringEscapeCodegen— codegen emits correct Go string with\r\ngo test ./codegen -run TestE2E_HelloWorldCourseModule— full pipeline: preprocess → transpile → compile → run hello_world.occ, verify outputgo test ./...— all existing tests still passgo vetregression:./occam2go -I kroc/modules/course/libsrc -D TARGET.BITS.PER.WORD=32 -o /tmp/course_out.go kroc/modules/course/libsrc/course.module && go vet /tmp/course_out.go🤖 Generated with Claude Code