DrRacket Interactions

Follow-up to my question above about a minimal process for upgrading...

I took the opportunity to upgrade to Racket v8.8 (from v8.7). I'm using macOS Monterey 12.6.3. I dragged the Racket v8.8 folder from the .dmg into the /Applications/Tools-Developer folder on my hard drive. I double-clicked the DrRacket.app icon and saw this:

I then made some false starts, but I believe the proper next steps are:

  • File -> Package Manager...
  • Click the "Copy from Version" tab
  • Select the previous version Racket
  • Click the "Copy from Version" button

I suspect quitting and re-launching Racket would make it all work. I'll review/update this procedure when Racket v8.9 comes out :slight_smile:

Ah, the problem here is not related to Quickscript that I previously suggested. Rather, it’s a combination of two things:

  1. You previously used #lang br in DrRacket on the version 8.7. DrRacket helpfully remembers the most recently used #lang in ~/Library/Preferences/org.racket-lang.prefs.rktd, so that when you open a new empty buffer, the #lang will automatically be placed for convenience.

  2. When you open a new empty buffer, the program will be run immediately. This is so that the REPL is loaded with the #lang environment, allowing you to use the REPL right away.

The issue is that after you freshly install the version 8.8, #lang br wouldn’t be installed yet, so when you open DrRacket, the automatic running causes the failure that you saw.

The heuristics to run a new empty buffer to load a #lang seems problematic to me. It has caused many other issues before. See https://github.com/mbutterick/pollen/issues/268 and https://github.com/racket/drracket/issues/555. I think it would be nice to revisit the heuristics and see if it’s actually needed, or if there’s anything we can do in a more principled manner.

1 Like

The goal is to get an interactions window that doesn't error (and isn't #lang racket/base or something like that) without having to run the program. I'm happy to try other approaches, for sure.

1 Like

I would still very much like this behavior to be something that is opted into and controlled at the #lang level. I find it annoying, to put it bluntly. When I want code to run I will run it.

1 Like

Well, turning it off would be easy enough to do, for sure.

1 Like

Is it possible on startup to show the loaded environment when there is no error, but in case of an error eat the error and show a empty text box?

(Obviously, when the user clicks the "run" button, DrRacket must show the error.)

That’s… even more heuristics. Though my biggest gripe is that currently DrRacket hard codes Pollen as an exception for the automatic running, which… doesn’t seem like the Right Thing(tm) to do. I would hope for a more extensible approach, along the line that @joeld mentioned.

To meet the goal of having a working interactions window at startup, would another workable solution be to to the following as part of installation? or on a prompt the first time DrRacket is started?

  1. Configure Command Line for Racket...
  2. Detect the previous installed version
  3. If previous version exists run raco pkg migrate < previous installed version>


Assuming Configure Command Line has side effects like writing to
shell configuration files or similar, I would (personally) not want
that to happen automatically.

Not even as a prompt?

Acceptable :slight_smile: but possibly as an option? Assuming I have the command-line set up properly, I might want DrR to just do the raco pkg migrate part.

We seem to be having multiple discussions in this thread so in the interest of keeping things clear about what each post is about, maybe we should move the discussion of the initial contents of the drracket interactions window to an issue in github where we can discuss what to do? I also think that Pollen's not part of any problem; I just hard coded it to avoid causing problems for folks. If we have what we think is a good solution in general, we can totally revisit who/what needs hardcoding.


At the risk of being even more off-topic, I know there exists a way for moderators to "convert" comments to new threads here; that might help clean things up from the perspective of a historical archive.

1 Like

I’ve called the new topic ‘DrRacket interactions’.
Let me know if you can think of a better title and I’ll delete these meta posts

1 Like