racket / racket/racket

raco setup does not give separate compilation guarantees for reader modules

Open
#1,506 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
5.2k
Forks
698
Avg merge
18h 34m
Merged PRs (30d)
5

Description

See this issue in the #lang afl repo for a lengthier discussion about this problem.

When raco setup -j 1 compiles several files, it does not load the reader for each file in a clean environment. Instead, the read-syntax function is cached between compilations, so that compiling two files which use the same #lang foo will obtain the reader function for the first file, and subsequently re-use that function for the second file.

Unfortunately, this means that readers which use global state like those created by hygienic-reader-extension may break when the files are compiled with raco setup -j 1, but not e.g. when the files are compiled with raco setup -j 4 (as they will be compiled by different processes, which do not share state).

I think it would be better if reader modules benefited from the same kind of separate compilation guarantees that regular modules have.

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

Start by reproducing the behavior with raco setup -j 1 and compare it with raco setup -j 4, focusing on how reader modules and read-syntax are loaded and cached. Done means separate compilation no longer reuses reader state between files, with a regression test covering multiple files using the same #lang reader.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.