<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Mark,<br>
<br>
On 11/13/2021 7:17 PM, Mark via Cuis-dev wrote:
<blockquote
cite="mid:4F0725DF-4D49-49AE-89E4-477B16397AB2@virtualmdj.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Hi,
<div class=""><br class="">
</div>
<div class="">I’m new to the Cuis implementation of Smalltalk.</div>
<div class="">I’ve dabbled with Squeak and Pharo in the past … and
then life would strike and distract me from it. :-)</div>
</blockquote>
<br>
Welcome!<br>
<br>
<blockquote
cite="mid:4F0725DF-4D49-49AE-89E4-477B16397AB2@virtualmdj.com"
type="cite">
<div class="">Now, I’m playing with Cuis — and I really like the
minimalist approach.</div>
<div class=""><br class="">
</div>
<blockquote style="margin: 0pt 0pt 0pt 40px; border: medium none;
padding: 0px;" class="">
<div class="">System: MacBook Pro 16” (2019)</div>
<div class="">OS: macOS Catalina (10.15.7)</div>
<div class="">Cuis image: Cuis5.0-4963.image</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">I’ve been working my way through “The Cuis” book (<a
moz-do-not-send="true"
href="https://cuis-smalltalk.github.io/TheCuisBook/" class="">https://cuis-smalltalk.github.io/TheCuisBook/</a>),
learning lots.</div>
</blockquote>
<br>
Cool.<br>
<br>
<blockquote
cite="mid:4F0725DF-4D49-49AE-89E4-477B16397AB2@virtualmdj.com"
type="cite">
<div class="">It’s all been running quite stable until today and
have run into two issues.</div>
<div class=""><br class="">
</div>
<div class="">(I did DuckDuckGo around to find similar issues, but
I didn’t find any. If these are noted somewhere, please point me
to them. Thanks! 🙂)</div>
<div class=""><br class="">
</div>
<div class="">ISSUE #1</div>
<div class=""><br class="">
</div>
<div class="">I got to the clock morph chapter (<a
moz-do-not-send="true"
href="https://cuis-smalltalk.github.io/TheCuisBook/A-Clock-Morph.html"
class="">https://cuis-smalltalk.github.io/TheCuisBook/A-Clock-Morph.html</a>)
and got the clock running.</div>
<div class=""><br class="">
</div>
<div class="">Then, I started playing with the #stepTime values —
just for fun. I set it to values like “16” and “66.7” and then,
suddenly, the whole environment froze.</div>
<div class=""><br class="">
</div>
<div class="">The Squeak menu still responded, but it wouldn’t
allow me to quit.</div>
<div class=""><br class="">
</div>
<div class="">I sent it a USR1 signal, and it generated a crash
dump, here: <a moz-do-not-send="true"
href="https://www.dropbox.com/s/1e4st9fp8xrm29p/crash-01.dmp?dl=0"
class="">https://www.dropbox.com/s/1e4st9fp8xrm29p/crash-01.dmp?dl=0</a></div>
<div class=""><br class="">
</div>
<div class="">Is this a known issue? I realize a step time of 16ms
(or possibly even 67.7ms) is pretty short, but I didn’t expect
it to freeze everything.</div>
<div class="">(Sadly, I hadn’t saved the image, so I lost all the
samples I’d added. :-( )</div>
<div class=""><br class="">
</div>
</blockquote>
<br>
The problem is not the #stepTime being too small (you can answer
zero, and it will do as many fps as your hardware allows). The
problem is that the system assumed it would always be an integer
number. I just posted to GitHub an update to truncate to integer
otherwise. Good catch!<br>
<br>
<blockquote
cite="mid:4F0725DF-4D49-49AE-89E4-477B16397AB2@virtualmdj.com"
type="cite">
<div class="">ISSUE #2</div>
<div class="">After restarting Cuis, I re-added the
LineExampleMorph (section 7.1.1 - <a moz-do-not-send="true"
href="https://cuis-smalltalk.github.io/TheCuisBook/Going-Vector.html"
class="">https://cuis-smalltalk.github.io/TheCuisBook/Going-Vector.html</a>)</div>
<div class="">And instantiated it.</div>
<div class="">It drew a green line.</div>
<div class=""><br class="">
</div>
<div class="">Then, I went to the class definition and changed its
superclass from Morph to MovableMorph and saved.</div>
<div class=""><br class="">
</div>
<div class="">Everything seems fine … but, when I clicked on the
existing green line, the debugger popped up</div>
<div class=""><br class="">
</div>
<div class="">So, I closed the debug window and went to the
Workspace window and executed “LineExampleMorph allInstancesDo:
[:x | x delete. ]”</div>
<div class="">The green line disappears, but a debug window popped
up.</div>
<div class="">So, I changed the class back to “Morph” … and then a
“Recompiling” dialog popped up … and stayed there.</div>
<div class="">Then debug windows started popping all over — to the
point where the whole display is unusable.</div>
<div class=""><br class="">
</div>
<div class="">It looks like it may have generated a log file for
each debug message (there are 16 of them … 😉)</div>
<div class=""><br class="">
</div>
<div class="">Here’s a screen recording (.mov file) of what it
looked like:<a moz-do-not-send="true"
href="https://www.dropbox.com/s/ja6hynzfpka5jua/Cuis-Smalltalk-Issue02.mov?dl=0"
class="">https://www.dropbox.com/s/ja6hynzfpka5jua/Cuis-Smalltalk-Issue02.mov?dl=0</a></div>
</blockquote>
<br>
As Hilaire already pointed out, changing the class definition while
having live instances might leave them in an inconsistent state. In
this case, the system doesn't know how to initialize the 'new'
instance variables added by MovableMorph being the superclass. They
are left as nil, and stuff breaks.<br>
<br>
<blockquote
cite="mid:4F0725DF-4D49-49AE-89E4-477B16397AB2@virtualmdj.com"
type="cite">
<div class="">I guess my overall questions are:</div>
<div class=""><span class="Apple-tab-span" style="white-space:
pre;"> </span>Should these kinds of things be happening?</div>
</blockquote>
<br>
Yes. It is like going in a car on the highway, and taking a wrench
and messing with the engine without even pulling to the curbside. It
is a consequence of a completely live and open system.<br>
<br>
<blockquote
cite="mid:4F0725DF-4D49-49AE-89E4-477B16397AB2@virtualmdj.com"
type="cite">
<div class=""><span class="Apple-tab-span" style="white-space:
pre;"> </span>Or are these somehow n00b errors on my part?</div>
</blockquote>
<br>
Not at all. I've developed the Morphic framework you are using.
You'd have to see the thousands times I froze my image because I
didn't realize the full consequences of some change.<br>
<br>
<blockquote
cite="mid:4F0725DF-4D49-49AE-89E4-477B16397AB2@virtualmdj.com"
type="cite">
<div class=""><span class="Apple-tab-span" style="white-space:
pre;"> </span>How can I ensure data is lost as I experiment
with the environment?</div>
</blockquote>
<br>
Ensuring date is lost is really easy!!! I guess you mean ensuring
data is not lost!<br>
<br>
The system keeps track of all the code you write and the Smalltalk
expressions you evaluate. These are not lost even if you kill
Smalltalk from the host OS. Check the *.changes files. WRT to live
objects in the image, these will be lost if you need to kill the
image for whatever reason. An alternative is to save the image from
time to time. Personally, I generally prefer to create examples with
'doit' Workspace expressions. These get saved in the
*.user.*.changes files.<br>
<br>
<blockquote
cite="mid:4F0725DF-4D49-49AE-89E4-477B16397AB2@virtualmdj.com"
type="cite">
<div class=""><span class="Apple-tab-span" style="white-space:
pre;"> </span>Since the whole philosophy of Smalltalk is to
be able to examine the whole system and try things, I’d like to
do that without worrying that the next thing I do could blow up
the environment. 😉</div>
<div class=""><span class="Apple-tab-span" style="white-space:
pre;"> </span>These don’t seem like things that should freeze
the environment.</div>
</blockquote>
<br>
I don't think that is even possible. If you can examine any part of
the system, there will always ways to break it. Smalltalk is not a
sandbox for safe playing. Don't worry. You'll get used to it, and
learn how to never lose your stuff. The freedom Smalltalk gives you
is well worth this learning experience!<br>
<br>
<blockquote
cite="mid:4F0725DF-4D49-49AE-89E4-477B16397AB2@virtualmdj.com"
type="cite">
<div class="">Thanks, in advance, for any insights you might have.</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:
pre;"> </span>— Mark</div>
</blockquote>
<br>
You're most welcome. Keep telling about stuff you find annoying.
Fresh eyes always see new things. This time, for instance, you
reported two, and one of them resulted in an enhancement. The other,
hopefully, helped you learn something. Both were positive outcomes!<br>
<br>
Cheers,<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
<a class="moz-txt-link-abbreviated" href="http://www.cuis-smalltalk.org">www.cuis-smalltalk.org</a>
<a class="moz-txt-link-freetext" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a class="moz-txt-link-freetext" href="https://github.com/jvuletich">https://github.com/jvuletich</a>
<a class="moz-txt-link-freetext" href="https://www.linkedin.com/in/juan-vuletich-75611b3">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</pre>
</body>
</html>