<!DOCTYPE html>
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><font size="4">Hi folks, <br>
      </font></p>
    <p><font size="4">Some thinking related to a recurring issue I have
        with end-user edited Smalltalk sketch script, particularly when
        debugging.<br>
      </font></p>
    <p><font size="4">For the record, in DrGeo a user can design
        interactive geometric sketch with mouse and clic operation.
        There is also the possibility for the user to design such script
        with programming instruction. It is a way of doing part of the
        DrGeo genome since its early development. </font></p>
    <p><font size="4">When DrGeo was coded in C++, scripts were written
        in Scheme, an Italian teacher wrote some contents about it[1].
        When porting to Squeak, I was hoping to describe script with
        Etoys, to be honest it is the main reason I ported from C++ to
        Squeak then. So I started to add Etoys tile to control DrGeo
        points, but I did not have the time to go far enough[2], then
        Etoys long term visibility was in question. </font></p>
    <p><b><font size="4">At some point we should have a tile framework
          for Cuis for general use in end user scripting.<br>
        </font></b></p>
    <p><font size="4">While tile are nice, it has a tendency to not be
        very compact, but it could be fixed with tile representing more
        high level concept.</font></p>
    <p><font size="4">Anyway, when editing script, at some point the
        user has to deal with complexity when debugging its script. It
        is true with Scheme and Smalltalk, with C++ version of Squeak,
        Etoys, Pharo and Cuis version of DrGeo<br>
      </font></p>
    <p><font size="4">Adele Goldberg, at her June 2022 talk for Camp
        Smalltalk 50th Anniversary, insisted a lot, at several moment,
        in how a system with a perspective of educating should be able
        to present meaningful information:</font></p>
    <p><font size="4"><br>
      </font></p>
    <div align="justify">
      <blockquote>
        <p><i><b>The Simulation Kit</b><br>
            An important point made by our teaching experience is that,
            because we expect the learner to<br>
            extend a model through programming new methods, not just by
            parameter modification, it is<br>
            critical that some outcome that the learner mistakenly
            creates does not get explained using<br>
            vocabulary outside of what has been already been introduced.<br>
            The obvious example from the Smalltalk system itself is its
            class browser and the debugger.<br>
            <b>Imagine you are creating a weather forecasting model and
              an error occurs in execution. But<br>
              instead of seeing the error at the level of weather
              activity and the buttons and dials of the weather<br>
              station, you see a bug in how text is displayed on the
              screen, thereby introducing an underlying<br>
              part of the modeling environment that you have not yet
              learned about (and maybe do not want to<br>
              learn about!). Certainly, dealing with an error outside of
              a kit is a distraction, potentially<br>
              defocusing the learner’s modeling intentions.</b></i><br>
        </p>
      </blockquote>
    </div>
    <p><font size="4"><br>
      </font></p>
    <p><font size="4">You can read her full presentation "Smalltalk
        research through the eyes of an educational mission"[3].  Her
        speeches and writing are always pleasant to read with actionable
        ideas.<br>
      </font></p>
    <p><font size="4">What Adele describes are the challenges I am
        facing in DrGeo end user scripting. The extended model is the
        interactive geometry model of Dr. Geo.</font></p>
    <p><font size="4">Below in latest stable release of DrGeo (23.12),
        the user wrote a one line script causing an obvious error. From
        the end user perspective, the situation is not great, the
        debugger pop-up in the classical distinct debugger window. So
        far I did  not find how to have it integrated in the Smalltalk
        sketch editor but the context of the bug is not that bad, it is
        one line off:</font></p>
    <img moz-do-not-send="false"
      src="cid:part1.0NHNMn6B.tWRXpDqP@free.fr" alt="debug 23.12"
      width="569" height="441">
    <p><font size="4">For the next release of DrGeo (now in Cuis6.3), I
        want to improve the debugger experience by integrating the
        debugger window in the sketch editor. But so far I fail to find
        how to do that, and the experience is even worst, as there is
        error after error. </font><font size="4">If you want to help
        contact me:</font></p>
    <img moz-do-not-send="false"
      src="cid:part2.RRIiQNhs.ofo8oqdy@free.fr" alt="drgeo 24.xx"
      width="715" height="532">
    <p><font size="4"><br>
      </font></p>
    <p><font size="4">What I am doing now to try to capture the window
        is:</font></p>
    <p><!-- HTML generated using hilite.me --></p>
    <div
style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;">
      <pre style="margin: 0; line-height: 125%"><span
      style="color: #0066BB; font-weight: bold">executeSketch</span>
        <span style="color: #007020">self</span> <span
      style="color: #0066BB; font-weight: bold">stopSketch</span>.
        <span style="color: #996633">codeView</span> <span
      style="color: #0066BB; font-weight: bold">scroller</span> <span
      style="color: #0066BB; font-weight: bold">acceptContents</span>.
        <span style="color: #007020">self</span> <span
      style="color: #0066BB; font-weight: bold">switchToPauseButton</span>.
        <span style="color: #BB0066; font-weight: bold">DrGeoSketch</span> <span
      style="color: #0066BB; font-weight: bold">when:</span> <span
      style="color: #AA6600">#newSmalltalkSketch</span> <span
      style="color: #0066BB; font-weight: bold">send:</span> <span
      style="color: #AA6600">#compiledSketch:</span> <span
      style="color: #0066BB; font-weight: bold">to:</span> <span
      style="color: #007020">self</span>.
        <span style="color: #996633">sketchProcess</span> <span
      style="color: #333333">:=</span> [ <span style="color: #333333">|</span> <span
      style="color: #996633">t</span> <span
      style="color: #0066BB; font-weight: bold">|</span>
                <span style="color: #996633">t</span> <span style="color: #333333">:=</span> <span
      style="color: #BB0066; font-weight: bold">DateAndTime</span> <span
      style="color: #0066BB; font-weight: bold">now</span>.
                [<span style="color: #BB0066; font-weight: bold">Compiler</span> <span
      style="color: #0066BB; font-weight: bold">evaluate:</span> <span
      style="color: #996633">model</span>] 
                        <span style="color: #0066BB; font-weight: bold">on:</span> <span
      style="color: #BB0066; font-weight: bold">Exception</span> 
                        <span style="color: #0066BB; font-weight: bold">do:</span> [<span
      style="color: #996633">debugger</span> <span
      style="color: #333333">:=</span> <span
      style="color: #BB0066; font-weight: bold">Debugger</span> 
                                        <span style="color: #0066BB; font-weight: bold">openMinimalDebuggingProcess:</span> <span
      style="color: #996633">sketchProcess</span> 
                                        <span style="color: #0066BB; font-weight: bold">context:</span> <span
      style="color: #996633">sketchProcess</span> <span
      style="color: #0066BB; font-weight: bold">suspendedContext</span> .
                                <span style="color: #007020">self</span> <span
      style="color: #0066BB; font-weight: bold">plugDebugger</span> ].
                <span style="color: #888888">" When we get there, sketch has been entirely executed, switch back to play button "</span>
                <span style="color: #007020">self</span> <span
      style="color: #0066BB; font-weight: bold">switchToPlayButton</span>.
                <span style="color: #BB0066; font-weight: bold">Transcript</span> <span
      style="color: #0066BB; font-weight: bold">show:</span> <span
      style="color: #BB0066; font-weight: bold">DateAndTime</span> <span
      style="color: #0066BB; font-weight: bold">now</span> <span
      style="color: #0066BB; font-weight: bold">-</span> <span
      style="color: #996633">t</span> ;<span
      style="color: #0066BB; font-weight: bold">cr</span>] <span
      style="color: #0066BB; font-weight: bold">newProcess</span>.
        <span style="color: #996633">sketchProcess</span> 
                <span style="color: #0066BB; font-weight: bold">priority:</span> <span
      style="color: #BB0066; font-weight: bold">Processor</span> <span
      style="color: #0066BB; font-weight: bold">userSchedulingPriority</span> ;
                <span style="color: #0066BB; font-weight: bold">name:</span> <span
      style="background-color: #fff0f0">'[DrGeo] Smalltalk Sketch execution'</span>;
                <span style="color: #0066BB; font-weight: bold">resume</span>.
</pre>
    </div>
    <p><font size="4"><br>
      </font></p>
    <p><font size="4">Thanks to take the time to read that far!<br>
      </font></p>
    <p><font size="4"><br>
      </font></p>
    <p><font size="4">[1]
<a class="moz-txt-link-freetext" href="https://www.matematicamente.it/staticfiles/software_math/dr_geo/schemedrgeo.pdf">https://www.matematicamente.it/staticfiles/software_math/dr_geo/schemedrgeo.pdf</a><br>
        [2] <a class="moz-txt-link-freetext" href="https://inria.hal.science/inria-00531636v1">https://inria.hal.science/inria-00531636v1</a><br>
        [3]
        <a class="moz-txt-link-freetext" href="https://drive.google.com/file/d/15vUiDzClBMAN8931bWe7O9oYHtNMzoQG/view">https://drive.google.com/file/d/15vUiDzClBMAN8931bWe7O9oYHtNMzoQG/view</a><br>
      </font></p>
    <p><font size="4"><br>
      </font></p>
    <pre class="moz-signature" cols="72">-- 
GNU Dr. Geo
<a class="moz-txt-link-freetext" href="http://gnu.org/s/dr-geo/">http://gnu.org/s/dr-geo/</a>
<a class="moz-txt-link-freetext" href="http://gnu-drgeo.blogspot.com/">http://gnu-drgeo.blogspot.com/</a></pre>
  </body>
</html>