Smalltalk development tools in Scratch

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Smalltalk development tools in Scratch

Hannes Hirzel
>
> Treat me like a beginner. I have two targets:
>
> 1. I want to document the source code of Scratch.
>
> 2. I want to modify Scratch.
>
>
...
> You change code using browsers in Smalltalk itself.  It's not a good idea
> to
> try to change code in the files.
....

> You create new classes using a Smalltalk browser.  While you could use a
> file and file in the file it's not a good idea to change code in files.
>
>
>
> Squeak by Example [8] talks about a 'hierarchy browser' which is easy to
> find with the files provided with it. Is there a similar kind of thing to
> explore Scratch objects? If yes, how to get to it. If no, how do can I
> trace
> the hierarchy of inheritance objects used to make Scratch.


Yes, you can 'get behind the scenes in Scratch' by using a 'rabbit
hole' as Markus Gaelli wrote

http://lists.squeakfoundation.org/pipermail/squeak-dev/2013-January/168424.html

"You know that you can "shift click" into the top half of the R of
SCRATCH on the top left of Scratch -- then open the rabbit hole via
"turn fill screen off"...


The thread in January 2013 started by Stephane Rollandin asking
http://lists.squeakfoundation.org/pipermail/squeak-dev/2013-January/168401.html

<citation>
Hello,

I'm currently studying the Scratch code. The image I have (the BYOB 1.3
image) has a Smalltalk version of 'MIT Squeak 0.9.4 (June 1, 2003)'.

How could I find the original corresponding base Squeak image (that is,
the same image without Scratch code) ?

Stef
</citation>

HTH

--Hannes

Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk development tools in Scratch

mokurai
In Scratch, Etoys, and Squeak there is an excellent suite of development
tools (an Integrated Development Environment, or IDE) that you can access
from various menus and tool palettes. Much of this is documented in
various Squeak manuals and tutorials. I am working on a version for Etoys
at FLOSS Manuals explaining how to get at the IDE tools, and a bit about
how each works.

http://booki.flossmanuals.net/etoys-reference-manual-vol-ii/_edit/

The System Browser lets the student and developer explore the class
hierarchy of the system it lives in, including the code of all methods,
and to modify anything or add and organize new classes and methods. You
can search for variables, method names (selectors), code fragments, and
much more. Class definitions provide extensive documentation of the source
in each system.

All of these are known as introspection tools. Smalltalk and systems built
on it have the best introspection tools in the business.

After you get a chance to explore Scratch, please let us know what other
documentation you think would be needed.

The companion vol. I of the Etoys Reference Manual documents the User
Interface and available Objects in the parts of Etoys meant for children,
where the features described in vol. II are somewhat hidden from users
unless you know how to turn the limitations off or bypass them. (Turn
eToyFriendly off and the debugHaloHandle on in Preferences. Set the
Chicago developer theme, and turn off ('destroy') the Sugar flaps to get
to where you can turn the Developer flaps on. Or skip all that to start
with, and just learn the keyboard shortcuts to get at the various hidden
menus and tools.)

Continuing on Scratch: After you turn the fill screen off, you can click
at the bottom of the window, outside the ScratchFrame, to get the World
menu. From there you can open various tools. From inside a number of these
tools, you can open many other tools, including the hierarchy browser,
from various menus and toolbars.

There are many differences of detail between the various tools in the
three environments, and the access to other tools from within them. I
cannot give you the whole story in an e-mail, of course, but I can
recommend that you move your cursor around in the System Browser and other
tools to see where menu icons pop up, and that you select names of
objects, variables, methods, and so forth, and shift-click to see what is
on the menus for each of them. Also right-click everywhere to get the
names of Objects and to gain access to halo tools and menus. I also
strongly suggest that you make notes. There is a remarkable lot of
information that you can discover, and then have to remember how to get
to. Let us know how that goes.

We could at some point create a detailed manual for the Scratch/Squeak
IDE, similar to what I am working on now for the Etoys/Squeak IDE.

I am also collecting references for a bibliography of Smalltalk, Squeak,
Scratch, and Etoys.

On Thu, June 20, 2013 11:27 pm, H. Hirzel wrote:
>>
>> Treat me like a beginner. I have two targets:
>>
>> 1. I want to document the source code of Scratch.
>>
>> 2. I want to modify Scratch.

I would like to suggest that as a beginner, you should start by
understanding how Scratch works as presented to its intended users, and
what it is capable of, before diving under the hood.

> ...
>> You change code using browsers in Smalltalk itself.  It's not a good
>> idea to try to change code in the files.
> ....
>
>> You create new classes using a Smalltalk browser.  While you could use a
>> file and file in the file it's not a good idea to change code in files.
>>
>>
>>
>> Squeak by Example [8] talks about a 'hierarchy browser' which is easy to
>> find with the files provided with it. Is there a similar kind of thing
>> to
>> explore Scratch objects? If yes, how to get to it. If no, how do can I
>> trace
>> the hierarchy of inheritance objects used to make Scratch.
>
>
> Yes, you can 'get behind the scenes in Scratch' by using a 'rabbit
> hole' as Markus Gaelli wrote
>
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2013-January/168424.html
>
> "You know that you can "shift click" into the top half of the R of
> SCRATCH on the top left of Scratch -- then open the rabbit hole via
> "turn fill screen off"...
>
>
> The thread in January 2013 started by Stephane Rollandin asking
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2013-January/168401.html
>
> <citation>
> Hello,
>
> I'm currently studying the Scratch code. The image I have (the BYOB 1.3
> image) has a Smalltalk version of 'MIT Squeak 0.9.4 (June 1, 2003)'.
>
> How could I find the original corresponding base Squeak image (that is,
> the same image without Scratch code) ?
>
> Stef
> </citation>
>
> HTH
>
> --Hannes
>
>


--
Edward Mokurai
(&#40664;&#38647;/&#2344;&#2367;&#2358;&#2348;&#2381;&#2342;&#2327;&#2352;&#2381;&#2332;/&#1606;&#1588;&#1576;&#1583;&#1711;&#1585;&#1580;)
Cherlin
Silent Thunder is my name, and Children are my nation.
The Cosmos is my dwelling place, the Truth my destination.
http://wiki.sugarlabs.org/go/Replacing_Textbooks



Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk development tools in Scratch

Stéphane Rollandin
In reply to this post by Hannes Hirzel
> <citation>
> Hello,
>
> I'm currently studying the Scratch code. The image I have (the BYOB 1.3
> image) has a Smalltalk version of 'MIT Squeak 0.9.4 (June 1, 2003)'.
>
> How could I find the original corresponding base Squeak image (that is,
> the same image without Scratch code) ?
>
> Stef
> </citation>

... and as a result I made available a working (although unfinished)
Scratch loadable in a current Squeak:

http://lists.squeakfoundation.org/pipermail/squeak-dev/2013-February/168899.html

Stef


Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk development tools in Scratch

timrowledge
In reply to this post by mokurai
There seems to be some confusion here. I'll start from some basic points just to (try to) be clear. Chris Cunnington's advice is a good place to start btw.

Scratch is written in Squeak Smalltalk, starting from a 2.8 image and removing quite a lot of code to reduce the image size. The Scratch system is implemented via a sort-of simulation of a computing engine, almost like a vm within the Squeak system.

Quite a lot of that code is a bit… untidy. I'm currently working to improve that for the Raspberry Pi Foundation and the latest release for the Pi (the image will run perfectly well on any other platform so far as I can tell) is around twice as fast for some important large Scratch projects. We also have a faster bitblt in testing right now, with a lot of ARM support but a fair bit that is generic and might benefit other cpu powered machines.

The delivered Scratch image is moderately locked down. As mentioned by Hannes, you can get to the Squeak side of the world with a simple shift-click but since there is no conncetion to the sources or changes files you won't have a terribly pleasnat time trying to make sense of the world. To see actual sources - with some comments even! - I suggest downloading the GPL release of the entire system that includes an image with the sources and changes still active, plus a load of media files to play with etc.

(Except that I can't find the download place anymore, since they seem to have replaced the entire website to support this newfangled Scratch 2.0 written in Flash (Flash! Of all things…). Does anyone knw where the GPL release has gone to? I see the http://scratch.mit.edu/scratch_1.4/ page but that only appears to have 'end user' packages.)

Anyway, Azka, you will need to become conversant with all the normal coding tools in Squeak in order to make sense of any of it. The first confusion you seem to have picked up is that editing the sources file is a good idea; it's not. You never, ever, edit that file with any sort of text editor. Smalltalk is not some quaint textfile based compiler system. The only way to change the code is to use the tools in the image; the code browsers etc.



tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Change is inevitable....except from vending machines.



Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk development tools in Scratch

Stéphane Rollandin

> I'm currently working to improve that for the Raspberry Pi Foundation and the latest release for the Pi (the image will run perfectly well on any other platform so far as I can tell) is around twice as fast for some important large Scratch projects.

Is this available somewhere ?

Stef


Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk development tools in Scratch

Bert Freudenberg
In reply to this post by timrowledge
On 21.06.2013, at 10:37, tim Rowledge <[hidden email]> wrote:

> Does anyone knw where the GPL release has gone to?

http://info.scratch.mit.edu/GPLv2_Licensed_Scratch_Code

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk development tools in Scratch

timrowledge

On 21-06-2013, at 11:30 AM, Bert Freudenberg <[hidden email]> wrote:

> On 21.06.2013, at 10:37, tim Rowledge <[hidden email]> wrote:
>
>> Does anyone knw where the GPL release has gone to?
>
> http://info.scratch.mit.edu/GPLv2_Licensed_Scratch_Code


Great; I really couldn't find it pointed to anywhere on the current site pages and even a quick google for the page name etc doesn't find anything obvious. It looks like there is a place for it on github too -  https://github.com/LLK/Scratch_1.4 which is probably a safer place to keep a pointer to.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Computers are only human.



Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk development tools in Scratch

timrowledge
In reply to this post by Stéphane Rollandin

On 21-06-2013, at 11:11 AM, Stéphane Rollandin <[hidden email]> wrote:

>
>> I'm currently working to improve that for the Raspberry Pi Foundation and the latest release for the Pi (the image will run perfectly well on any other platform so far as I can tell) is around twice as fast for some important large Scratch projects.
>
> Is this available somewhere ?

Other than in whatever repository the Pi foundation uses, not yet. So far as I can tell, if you find a Raspbian repository (take a look at  http://www.raspbian.org/RaspbianMirrors) then scratch is under raspbian/pool/main/s/scratch, though whether a debian package is any use to you is debatable.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: OKP: On your Knees and Pray!



Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk development tools in Scratch

timrowledge
In reply to this post by Hannes Hirzel
Hmph, this seemingly failed to achieve orbit; so reposted.

Begin forwarded message:

Subject: Delivery Status Notification (Failure)
Date: 21 June, 2013 4:50:41 PM PDT

This is an automatically generated Delivery Status Notification.

Delivery to the following recipients failed.

      [hidden email]



Reporting-MTA: dns;mxin-05.name-services.com
Received-From-MTA: dns;SJL01WMXIN05.prod.dm.local
Arrival-Date: Fri, 21 Jun 2013 16:50:21 -0700

Final-Recipient: rfc822;[hidden email]
Action: failed
Status: 5.4.4

From: tim Rowledge <[hidden email]>
Subject: Re: [squeak-dev] Smalltalk development tools in Scratch
Date: 21 June, 2013 11:45:48 AM PDT
To: The general-purpose Squeak developers list <[hidden email]>
Reply-To: The general-purpose Squeak developers list <[hidden email]>



On 21-06-2013, at 11:30 AM, Bert Freudenberg <[hidden email]> wrote:

On 21.06.2013, at 10:37, tim Rowledge <[hidden email]> wrote:

Does anyone knw where the GPL release has gone to?

http://info.scratch.mit.edu/GPLv2_Licensed_Scratch_Code


Great; I really couldn't find it pointed to anywhere on the current site pages and even a quick google for the page name etc doesn't find anything obvious. It looks like there is a place for it on github too -  https://github.com/LLK/Scratch_1.4 which is probably a safer place to keep a pointer to.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Computers are only human.








tim
--
Useful random insult:- Teflon brain -- nothing sticks.