racket / racket/rhombus

BUG: DrRacket REPL corrupted (#%top-interaction: bad syntax) after error in definitions area

Open
#789 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
601
Forks
74
Avg merge
2d 10h
Merged PRs (30d)
5

Description

If a #lang rhombus file fails to compile (e.g., due to an unbound identifier), the DrRacket REPL enters a broken state. Any subsequent expression typed into the REPL fails with #%top-interaction: bad syntax.

Note: This only happens after an error in the definitions area, not from errors raised within the REPL itself.

Current Workaround: Running a file that compiles successfully resets and fixes the DrRacket REPL.

Steps to Reproduce

Make a file with the following code (deliberately having error) and run it in DrRacket:

#lang rhombus
 x

As expected REPL shows error when file is run. But after that, trying to run any valid code in DrRacket REPL also fails with syntax error:

x: unbound identifier in: x            
$ def a = 0      
. #%top-interaction: bad syntax in: (#%top-interaction . def)

Contributor guide

No contributing guide indexed for this repository

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 with the provided #lang rhombus reproducer in DrRacket, comparing the REPL state after a definitions-area compile error with the state after a REPL error. Trace the transition that causes subsequent valid expressions to produce #%top-interaction: bad syntax; done means the REPL accepts those expressions without requiring a successfully compiled file first.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.