htdp icon indicating copy to clipboard operation
htdp copied to clipboard

test results don't appear in stepper in #lang htdp/bsl

Open jbclements opened this issue 3 years ago • 12 comments

In the #lang-based teaching languages, test results don't appear in a box; instead, they get sent to stdout. This is pretty terrible, but it's not a regression; it was present in 8.1 as well.

How to reproduce:

  1. start drracket from the command-line
  2. enter this program:
#lang htdp/bsl

(check-expect (+ 3 4) 9)
  1. Click the "step" button, see no dialog. Check command line, see output.

jbclements avatar Jul 16 '21 02:07 jbclements

Is this a regression from 8.0? We would expect that to be the version previously used by teachers, I would guess.

samth avatar Jul 16 '21 02:07 samth

I don't think teachers use this version much if at all (yet).

Robby

On Thu, Jul 15, 2021 at 9:32 PM Sam Tobin-Hochstadt < @.***> wrote:

Is this a regression from 8.0? We would expect that to be the version previously used by teachers, I would guess.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/racket/htdp/issues/154#issuecomment-881131979, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADBNMAFK5MRWCBZMWIHZYDTX6K3BANCNFSM5AOVOKUA .

rfindler avatar Jul 16 '21 02:07 rfindler

Not a regression. In version 8.0 and before, attempting to use the stepper in #lang htdp/bsl failed for all programs, with the hideous internal error

send: no such method method name: stepper-button-callback class name: test-tab%-mixin175 context...: /Applications/Racket v8.0/collects/racket/private/class-internal.rkt:4663:0: obj-error /Applications/Racket v8.0/share/pkgs/htdp-lib/stepper/drracket-button.rkt:11:3 /Applications/Racket v8.0/collects/racket/private/more-scheme.rkt:148:2: call-with-break-parameterization /Applications/Racket v8.0/collects/ffi/unsafe/atomic.rkt:73:13 /Applications/Racket v8.0/share/pkgs/gui-lib/mred/private/wx/cocoa/window.rkt:897:4: dispatch-on-event method in window% /Applications/Racket v8.0/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:435:6 /Applications/Racket v8.0/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:486:32 /Applications/Racket v8.0/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:634:3

Am I unhappy about the current situation? Yes. But AFAIK it’s not a trivial fix, and it’s not any kind of regression. One might argue that it puts a hitch in a plan to take advantage of Mike Sperber’s hard work to make the #lang htdp/bsl language usable by recommending the use of #lang htdp/bsl exclusively, but this bug is basically just an observation that that project is not yet totally complete.

Let me know what you think.

John

On Jul 15, 2021, at 22:49, Robby Findler @.***> wrote:

I don't think teachers use this version much if at all (yet).

Robby

On Thu, Jul 15, 2021 at 9:32 PM Sam Tobin-Hochstadt < @.***> wrote:

Is this a regression from 8.0? We would expect that to be the version previously used by teachers, I would guess.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/racket/htdp/issues/154#issuecomment-881131979, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADBNMAFK5MRWCBZMWIHZYDTX6K3BANCNFSM5AOVOKUA .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

jbclements avatar Jul 16 '21 05:07 jbclements

I wouldn’t worry.

The people who use #lamg *sl are people who know how to recove from such a problem (Sam, me, Ben, Amal, perhaps our CN friends).

mfelleisen avatar Jul 16 '21 06:07 mfelleisen

To fix this problem, I need to set the output port to the REPL's value port.

Unfortunately, there doesn't seem to be a REPL. Is there any way to make one? (@rfindler, @jbclements)

(This would also fix the minor issue that display & friends print to stdout from the stepper.)

mikesperber avatar Jul 16 '21 06:07 mikesperber

I would say that the stepper should change to collect the output from the steps and show it, along with the stuff it is currently collecting.

rfindler avatar Jul 16 '21 12:07 rfindler

Taking a step (ha ha) back: "display and friends" don't appear to me to be defined in any of the htdp teaching languages, which is why there's currently no mechanism for the stepper to collect stdout. Mike, is that not the case in your teaching languages?

Yes, this is definitely something that can be done, and is part of moving the stepper forward towards htdp/asl (shimmering like a mirage in the infinite distance, alas). I don't think it's conceptually hard, but it definitely involves changing some pretty fundamental structures: specifically, a "step" will have to include the current contents of stdout.

jbclements avatar Jul 16 '21 14:07 jbclements

Well, I can (require racket).

@jbclements I'm aiming for a lower-hanging fruit: Just instantiate a regular REPL that is connected to the regular DrRacket interactions pane, and have the output go there, as it would outside the stepper. Is that more easily doable?

mikesperber avatar Jul 17 '21 14:07 mikesperber

Frankly, I have no idea: in my mind, the actual DrRacket Defs & Interactions window are something I know nothing about, and the stepper's only interaction is to fetch the text from the interactions window. I worry that trying to interact with the interactions window could create all kinds of weird new problems; race conditions etc. No?

jbclements avatar Jul 17 '21 14:07 jbclements

I agree with John on this point. The stepper should just run the program and capture its output (on each step).

Robby

On Sat, Jul 17, 2021 at 9:59 AM John Clements @.***> wrote:

Frankly, I have no idea: in my mind, the actual DrRacket Defs & Interactions window are something I know nothing about, and the stepper's only interaction is to fetch the text from the interactions window. I worry that trying to interact with the interactions window could create all kinds of weird new problems; race conditions etc. No?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/racket/htdp/issues/154#issuecomment-881911156, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADBNMHNH24644KDJKOQH4TTYGLDLANCNFSM5AOVOKUA .

rfindler avatar Jul 17 '21 16:07 rfindler

I agree with John on this point. The stepper should just run the program and capture its output (on each step). Robby

Do you have an idea where it would be displayed?

mikesperber avatar Jul 24 '21 06:07 mikesperber

On Sat, Jul 24, 2021 at 1:46 AM Mike Sperber @.***> wrote:

I agree with John on this point. The stepper should just run the program and capture its output (on each step). Robby

Do you have an idea where it would be displayed?

The stepper's GUI would have to change to accommodate it somehow. There would be a "before step" box, an "after step" box as there currently is, and a new "current amount of IO" box. Something like that.

Robby

rfindler avatar Jul 24 '21 12:07 rfindler