Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DrRacket stepper doesn't work with BSL in presence of ... (templates) #159

Closed
wilbowma opened this issue Sep 28, 2021 · 24 comments
Closed
Assignees

Comments

@wilbowma
Copy link

What version of Racket are you using?
8.0 cs -- 8.2.0.2 cs

What program did you run?
The following BSL programs trigger the bug when trying to run the stepper

(define (fn-for-loc)
  (...))
(+ 4 5)

The smallest examples is:

(...)

but I'm not sure what I'd expect this to do.

What should have happened?
The stepper should step through the (+ 4 5) expression.

If you got an error message, please include it here.
The stepper reports:

annotate: unexpected syntax for expression: (cons 'quote-syntax (cons empty (cons '#:local empty)))

Please include any other relevant details
macOS various versions; linux

@mfelleisen
Copy link
Contributor

My memory is that it never did, and I question this as a feature request. (If we do implement it, we have to bind ... to something at run-time to keep the stepper intact as is.)

@samth
Copy link
Sponsor Member

samth commented Sep 29, 2021

This program works properly in the stepper in 7.8 and 7.3, the two older versions I have lying around.

But even if it didn't, having the stepper not work at all for this program and give an incomprehensible error would not be an ok thing to give to students.

@mfelleisen
Copy link
Contributor

Well my memory is wrong :-) [[ Of course I agree about the error message. ]]

@jbclements
Copy link
Contributor

jbclements commented Sep 29, 2021 via email

@jbclements
Copy link
Contributor

Okay, I see most of what's going on. The annotation of ellipses ("...") has changed somewhat. It has two issues. The first is the introduction of a new top-level form (lifted/2), etc. The second is a special-case for ellipses used inside parens. In both cases the standard solution of using a stepper-mark doesn't work, because the outer form disappears before it reaches the annotater. Ugh.

@samth
Copy link
Sponsor Member

samth commented Oct 1, 2021

See also racket/drracket#143.

@jbclements
Copy link
Contributor

progress on this yesterday, I now understand the way in which the syntax system combines marks when syntax objects are transformed (by consing them together). I believe this was not the case when I wrote this code in like 1887 or something. Regardless, I believe I now have a clear path to eliminating the crash. Hiding the lifted thing will probably take a bit more thinking, but doesn't seem insurmountable. The first thing to make sure is that "fixing" the property lookup w.r.t. the consing behavior doesn't break something else that accidentally worked because of it.

@jbclements jbclements transferred this issue from racket/racket Oct 5, 2021
@jbclements
Copy link
Contributor

jbclements commented Oct 5, 2021

Fixed by 30bf554

@wilbowma
Copy link
Author

wilbowma commented Oct 5, 2021

Thanks! Can this be fixed by a raco update or will we need to install a snapshot?

@samth
Copy link
Sponsor Member

samth commented Oct 5, 2021

I think the following will update it, but I can't guarantee that the resulting code will work (I think it will, though):

raco pkg update --catalog https://pkgs.racket-lang.org htdp-lib

@wilbowma
Copy link
Author

wilbowma commented Oct 5, 2021

Okay, I'll test it out; thanks!

@wilbowma
Copy link
Author

wilbowma commented Oct 5, 2021

nope, I get a lot of build errors.

@samth
Copy link
Sponsor Member

samth commented Oct 5, 2021 via email

@wilbowma
Copy link
Author

wilbowma commented Oct 5, 2021

workspace/racket-dev/racket/share/pkgs/htdp-lib/test-engine/markup-gui.rkt:104:12: number-snip:number->string/snip: unbound identifier
  in: number-snip:number->string/snip
workspace/racket-dev/racket/share/pkgs/htdp-lib/lang/private/provide-and-scribble.rkt:132:53: except-in: identifier `posn' not included in nested require spec
  at: (submod lang/private/intermediate-funs)
workspace/racket-dev/racket/share/pkgs/htdp-lib/htdp/bsl/runtime.rkt:149:21: print-value-columns: unbound identifier
  in: print-value-columns

It's very probably my fault; this machine is on a 8.0 HEAD build. I'll try again from 8.1

@samth
Copy link
Sponsor Member

samth commented Oct 5, 2021 via email

@wilbowma
Copy link
Author

wilbowma commented Oct 5, 2021

Okay thanks

@mfelleisen
Copy link
Contributor

mfelleisen commented Oct 5, 2021 via email

@wilbowma
Copy link
Author

wilbowma commented Oct 6, 2021

Ben posted in the Slack that he ran into the second error, about posn, too on 8.2. Are we sure this didn't introduce a bug?

@blerner
Copy link

blerner commented Oct 6, 2021

I tried @samth's raco pkg update line and (a) the installation failed with the second warning @wilbowma received about missing posn definitions (but neither of the other two), and (b) DrRacket worked and stepped through templates correctly. I initially dismissed the warning about posns as merely being a warning in building docs or something, but then when I tried to build a scribble site, scribble failed as well with the same error.

I saved the console output of the raco pkg update command (with all its error messages) and can forward that along to anyone if it's of any use...

@jbclements
Copy link
Contributor

I've just been through the slack discussion, and I'm not sure I have a set of steps for reproducing the "posn problem". It looks like it might be sufficient to download a fresh 8.2 and use raco pkg update, does that sound right? I'll give it a try, but only if someone tells me that I'm reading this plausibly.

@wilbowma
Copy link
Author

wilbowma commented Oct 6, 2021

I think that should reproduce the problem.

@wilbowma
Copy link
Author

wilbowma commented Oct 6, 2021

You'll want to use this raco update command: raco pkg update --catalog https://pkgs.racket-lang.org htdp-lib

@jbclements
Copy link
Contributor

Okay, yes, I do see these errors. My current supposition is that this is because there are changes to htdp that depend on changes made to other packages, most likely racket itself. My hope is that these errors won't occur when we build 8.3 from source. Thinking about this more carefully, it would have made more sense just to say "let's try building from source, and seeing whether the error persists."

@wilbowma
Copy link
Author

I rebuilt from HEAD and it seems to work; thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants