## Scratch 2.0 is out 9th May

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

### Scratch 2.0 is out 9th May

Scratch 2.0 goes official on 9th May

http://scratch.mit.edu/forums/viewtopic.php?id=117391

Not of any practical use to RPi users of course since its all in Flash and web based

But, once the Scratch Team have ironed out the little bugs that no doubt will need sorting , then hopefully they can turn their attention to a "proper" downloadable version that we can run on the RPi that will let us get at the goodies such as making our own blocks

FAQ on Scratch 2.0 transition http://beta.scratch.mit.edu/discuss/topic/1168/

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

TRocket
Posts: 9
Joined: Mon Nov 26, 2012 8:54 am
Location: Somerset, UK

### Re: Scratch 2.0 is out 9th May

The downloadable version won't work on the pi.

It will be an adobe air style application...

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

### Re: Scratch 2.0 is out 9th May

Says who/where did they say it?

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

TRocket
Posts: 9
Joined: Mon Nov 26, 2012 8:54 am
Location: Somerset, UK

### Re: Scratch 2.0 is out 9th May

simplesi wrote:Says who/where did they say it?

Simon
http://scratch.mit.edu/forums/viewtopic ... 8#p1378278

SimonSmall
Posts: 220
Joined: Tue Oct 09, 2012 8:13 pm

### Re: Scratch 2.0 is out 9th May

I hope that I am wrong but it looks like Scratch 2 will be a web-only, flash based language, focussing on any programs being saved "cloud-style" on the Scratch 2 website. To use it "offline" seems to mean that it requires use of an obsolete, unsupported version of flash

I have been impressed by the concept of Scratch and, apart from a quick "play-around" to make the cat bounce from side to side, I have not spent a lot of time on it. I had thought that I might do this later

I am now worried that Scratch might be a dead end project for me. I am not clear where this leaves the things that have been done on the Pi, given that the Pi Foundation made such a big thing out of Scratch. I would appreciate a list of decent links to information about Scratch as a programming language; their website seems to be all community, this forum and the Pi wiki does not provide enough detail

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

### Re: Scratch 2.0 is out 9th May

From link by TRocket
As for offline - probably we'll end up using something like air, so the application looks / works the same online as it does off. It's *really* hard to get consistent performance and behavior with implementations written in different languages, so that's why we wouldn't try to make it in C or anything. But you are welcome to use the ideas from Scratch to make your own app!
Well - that pretty much looks like the last nail in coffin in our hopes for an offline Scratch 2.0

So, we'll just have to use what we've got - which is Scratch 1.4

Its still the original and although it may not waht we want - its still the best programming language for kids to learn and is the brand leader by a very long way

We still need to get it run at least twice as fast as it presently does on a non-pverclocked RPi - whether this effort would be best served by everyone piling in on TRocket's C++ port or just trying to get a faster squeak enviroment is just one of the questions to be answered.

I think there are some hard choices to be made

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

TRocket
Posts: 9
Joined: Mon Nov 26, 2012 8:54 am
Location: Somerset, UK

### Re: Scratch 2.0 is out 9th May

simplesi wrote:From link by TRocket
As for offline - probably we'll end up using something like air, so the application looks / works the same online as it does off. It's *really* hard to get consistent performance and behavior with implementations written in different languages, so that's why we wouldn't try to make it in C or anything. But you are welcome to use the ideas from Scratch to make your own app!
Well - that pretty much looks like the last nail in coffin in our hopes for an offline Scratch 2.0

So, we'll just have to use what we've got - which is Scratch 1.4

Its still the original and although it may not waht we want - its still the best programming language for kids to learn and is the brand leader by a very long way

We still need to get it run at least twice as fast as it presently does on a non-pverclocked RPi - whether this effort would be best served by everyone piling in on TRocket's C++ port or just trying to get a faster squeak enviroment is just one of the questions to be answered.

I think there are some hard choices to be made

Simon
In terms of speed c++ would probably be a hell of a lot faster than smalltalk(squeak is essentially a smalltalk vm) and c++ is a much more popular language than smalltalk/squeak...
I haven't been that active on itchy++ recently due to lack of developers.(it's really just me atm)

timrowledge
Posts: 1286
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

### Re: Scratch 2.0 is out 9th May

There is a lot of work being done to improve Scratch (and Squeak) performance on the Pi. If you care to download the test image from
https://www.dropbox.com/s/j8ellgf93w01y ... .image.zip (NB this is a test image and if you're reading this much after April '13 it probably won't be there!)
(and assuming I got the Dropbox settings right so you can get to it) then you should find a decent improvement for many projects - some of our benchmarks have doubled. Don't forget to save the original Scratch image somewhere safe in case you find bugs.

This image is all just work on improving the Smalltalk code that implements Scratch and there is still quite a bit to do. Work is underway to massively improve the performance of bitblt (the Smalltalk graphics operation) and to get the more recent and much faster Squeak virtual machines running on the Pi.

You can help this work by supplying projects that cause problems for us to benchmark and analyse.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

### Re: Scratch 2.0 is out 9th May

Who/where is this team of elves and why are they working secretly in the dark?

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

### Re: Scratch 2.0 is out 9th May

Just to help peopl testing out other Scratch images you can use the following procedure to simply have a new icon on the desktop to run it which leaves your original Scratch alone

Download the test image from the Dropbox link above and lets say you save it \\home\pi
Launch a LXTerminal session

Code: Select all

sudo cp //home/pi/Scratch.image /usr/bin/share/scratch/ScratchTest.image
cp //home/pi/scratch.desktop  //home/pi/scratchtest.desktop
nano //home/pi/scratchtest.desktop and change it to 

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Exec=/usr/bin/scratchtest.sh %f
Icon=scratch
Terminal=false
Name=ScratchTest
Comment= Programming system and content development tool
Categories=Application;Education;Development;
MimeType=application/x-scratch-project
save it (Ctrl-X then Y then Enter)

create a new file

Code: Select all

sudo nano /usr/bin/scratchtest.sh
and then copy this code and paste it into nano

Code: Select all

#!/bin/sh
# File:            scratchtest
# Description:     Script to start the Squeak VM binary with the scratch image
# Original Author: Bert Freudenberg
# Adapted by:      Miriam Ruiz and Simon Walters to run a test Scratch Image called ScratchTest

VM_VERSION=find /usr/lib/squeak/ -name "squeakvm" -type f|cut -f5 -d"/"
SQ_DIR=/usr/lib/squeak/$VM_VERSION VM="$SQ_DIR/squeakvm"
VMOPTIONS="-encoding UTF-8 -vm-display-x11 -xshm -plugins /usr/lib/scratch/plugins/:$SQ_DIR/" IMAGE="/usr/share/scratch/ScratchTest.image" IMOPTIONS="" DOCUMENT="" WRAPPER="" #set to 1 to work around OLPC bug #8008 export SQUEAK_FAKEBIGCURSOR=0 # default directories (used if not running as Sugar activity) [ -z "$SQUEAK_SECUREDIR" ] && export SQUEAK_SECUREDIR="$HOME/.scratch/private" [ -z "$SQUEAK_USERDIR" ] && export SQUEAK_USERDIR="$HOME/Scratch" [ ! -d "$SQUEAK_SECUREDIR" ] && mkdir -p "$SQUEAK_SECUREDIR" && chmod 700 "$SQUEAK_SECUREDIR"
[ ! -d "$SQUEAK_USERDIR" ] && mkdir -p "$SQUEAK_USERDIR"

[ ! -d "$HOME/Documents" ] && mkdir -p "$HOME/Documents"

usage()
{
echo "Usage: scratch [--param value] [-vmopt value] [arg value]"
echo "       where --param is --vm, --image, or --document;"
echo "       -vmopt is an option passed to the Squeak VM;"
echo "       and args are passed to the Squeak image."
}

if [ $# -eq 1 ] ; then case "$1" in
/*) DOCUMENT="$1" ;; *) DOCUMENT="$PWD/$1" ;; esac shift else while [ -n "$1" ] ; do
if [ -z "$2" ] ; then usage exit -1 fi case "$1" in
--help)
usage
exit
;;
--document)
case "$2" in /*) DOCUMENT="$2"
;;
*) DOCUMENT="$PWD/$2"
;;
esac
shift
;;
--image)
case "$2" in /*) IMAGE="$2"
;;
*) IMAGE="$PWD/$2"
;;
esac
shift
;;
--vm)
case "$2" in /*) VM="$2"
;;
*) VM="$PWD/$2"
;;
esac
shift
;;
-*) VMOPTIONS="$VMOPTIONS$1 $2" shift ;; *) IMOPTIONS="$IMOPTIONS $1$2"
shift
;;
esac
shift
done
fi

# do not crash on dbus errors
export DBUS_FATAL_WARNINGS=0

# make Compose input methods work
# 30/01/2013: apprently this causes issues, so comment out. [email protected]
#[ -z "$LC_ALL" ] && export LC_ALL="$LANG"

VMOPTIONS="$VMOPTIONS -vm-sound-alsa" # VM, Image, and Document are non-optional # Document has to be present even if empty for IMOPTIONS to work echo Executing:$WRAPPER "$VM"$VMOPTIONS "$IMAGE" "$DOCUMENT" $IMOPTIONS exec$WRAPPER "$VM"$VMOPTIONS "$IMAGE" "$DOCUMENT" \$IMOPTIONS

and then save by Ctrl-X then Y then Enter

and then finally

Code: Select all

sudo chmod +x /usr/bin/scratchtest.sh
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

### Re: Scratch 2.0 is out 9th May

@timrowledge

The "test suite" that we've been using is the one from the thread that kicked all the discussion off - @Cliffords Asteroid Blaster
http://scratch.mit.edu/projects/cliffor ... be/2697920

I simply time how long it takes to fire a missile into the corner

The normal scratch (I mean the last time Alex Bradbury updated it) is takes about 2.8 secs to hit the corner of the screen in medium window and its failry agreed that its not really playable

in full screen mode it takes about 1.7 in full screen

This is on 700MHx RPi

I think its playable in full screen on a 1GHz turbo mode RPi but since all my RPi corrupt SD cards at 1Ghz I've given up on that approach as a workable solution

I'm not noticing any noticeable speed increase in the image you've linked to BTW

What Scratch code would show off the improvements?

regards
Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

timrowledge
Posts: 1286
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

### Re: Scratch 2.0 is out 9th May

OK, haven't come across Asteroid Blaster before; I'll give it a try.
The big scary benchmark we have been using is a very complete PacMan http://scratch.mit.edu/projects/aoliver2/2345919
On a vanilla Pi/Raspbian/Scratch I see slightly less than 2 frames/sec (about 600mS per cycle) and on the newer image around 250mS/cycle.

By way of a comparison with big desktop machines my 3GHz iMac can just barely manage 24mS with vanilla Scratch but ~19mS with the new image.

So - on my non-overclocked Raspbian Pi I get 16-20 frames/sec on asteroids with the new image. It's oddly jerky which certainly needs looking at, and it exposes an error that I've not been hit by before, which is always useful to know about. I'll get that fixed soon.

When you say
I simply time how long it takes to fire a missile into the corner
what exactly do you do? Are you moving the ship to a corner and firing to the opposite corner? Firing from the centre?

Try clicking on the 'R' in the Scratch at tope-left with the shift key down, choosing 'turn fill screen off' and then on the newly exposed desktop area use the middle-mouse-button to get the 'World' menu, choose 'new morph…' and then 'Demo>' & 'Frame rate morph'. Drop the morph somewhere visible and it will keep you appraised of the frame rate (duh).
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

jamesh
Raspberry Pi Engineer & Forum Moderator
Posts: 23900
Joined: Sat Jul 30, 2011 7:41 pm

### Re: Scratch 2.0 is out 9th May

TRocket wrote:The downloadable version won't work on the pi.

It will be an adobe air style application...
Going with Flash, an outdated and about to be deprecated (already on mobile devices) system, was an almost criminal decision by the Scratch developers IMO. I think many will need to stick with 1.4, and not just on the Raspi.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

### Re: Scratch 2.0 is out 9th May

what exactly do you do? Are you moving the ship to a corner and firing to the opposite corner? Firing from the centre?
Just sit in the middle and fire into top left corner.

But basically it all about whether its considered playable by an 8 year old that counts

II'llkk give the Pacman game a whirl and use your frame rate tool - ta

Going with Flash... was an almost criminal decision by the Scratch developers IMO. I think many will need to stick with 1.4, and not just on the Raspi.
I think it more just bad timing than criminal.

It stemmed from the fact that a few years ago they developed an on-line flash player instead of their Java one and when they started on Scratch 2.0 - flash still ruled everywhere except on Pads Its just taken them so long to get Scratch 2.0 out of the door that it now looks silly to us.

I don't know if sticking to 1.4 will be possible (on main clasrroom computers) because once the kids are into Scratch- they'll go home and use 2.0 and then they are going to come back and ask why we aren't using it in school - it'll make us look like Dinosaurs - they won't care about using the wrong platform.

But on the RPi - its going to be 1.4 - which is still good of course

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

jamesh
Raspberry Pi Engineer & Forum Moderator
Posts: 23900
Joined: Sat Jul 30, 2011 7:41 pm

### Re: Scratch 2.0 is out 9th May

simplesi wrote:
what exactly do you do? Are you moving the ship to a corner and firing to the opposite corner? Firing from the centre?
Just sit in the middle and fire into top left corner.

But basically it all about whether its considered playable by an 8 year old that counts

II'llkk give the Pacman game a whirl and use your frame rate tool - ta

Going with Flash... was an almost criminal decision by the Scratch developers IMO. I think many will need to stick with 1.4, and not just on the Raspi.
I think it more just bad timing than criminal.

It stemmed from the fact that a few years ago they developed an on-line flash player instead of their Java one and when they started on Scratch 2.0 - flash still ruled everywhere except on Pads Its just taken them so long to get Scratch 2.0 out of the door that it now looks silly to us.

I don't know if sticking to 1.4 will be possible (on main clasrroom computers) because once the kids are into Scratch- they'll go home and use 2.0 and then they are going to come back and ask why we aren't using it in school - it'll make us look like Dinosaurs - they won't care about using the wrong platform.

But on the RPi - its going to be 1.4 - which is still good of course

Simon
Going with a propriety system like flash where you are at the whim of the technology owner is where, I guess, it all went wrong. Adobe decides no more Flash, and out it goes. Flash isn't even a good choice anyway, slow and full of bugs.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

### Re: Scratch 2.0 is out 9th May

Flash isn't even a good choice anyway, slow and full of bugs.
The Scratch team are all about share and enjoy and this was arguably the best tool for doing that at the time they started.

It might have good consequcnes in that that the "community" might finally rally around a true open-source,multi-platform, block based teaching language and just leave Scratch 2.0 as a home activity for making games
Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

timrowledge
Posts: 1286
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

### Re: Scratch 2.0 is out 9th May

Try filing the attached very, very, trivial changes file to fix the buglet Asteroid Blaster exposed. As the file comment says, I'm surprised by this since I ran dozens of projects for hundreds of hours without seeing the problem. I think it probably says a lot about the wide variety of programming styles in Scratch projects.

Roughly timing on my Pi, firing from the centre of the screen to the bottom-right corner, timed by using the stopwatch on my iPhone, I get about 1.5secs
011-Non-BlockMorph-unhighlight.1.cs.zip
(971 Bytes) Downloaded 307 times
<- zipped because the forum software dislikes '.cs' files.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

### Re: Scratch 2.0 is out 9th May

Roughly timing on my Pi, firing from the centre of the screen to the bottom-right corner, timed by using the stopwatch on my iPhone, I get about 1.5secs
Which window mode - small - medium or full screen ?
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

timrowledge
Posts: 1286
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

### Re: Scratch 2.0 is out 9th May

Medium - the normal 480*360 screen
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

### Re: Scratch 2.0 is out 9th May

mm - something not quite right then at my end - I can only get down to 1.5 secs by running in presentation mode - what timings do you get in presentation mode?

But don't let me deviate you from trying to improve things - if your seeing significant speed increases at your end - great

I'll get back trying finish off my GPIO stuff (Which doesn't need the speed boost as much )

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

timrowledge
Posts: 1286
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

### Re: Scratch 2.0 is out 9th May

That's very odd; I get a consistent 1.6/7 secs for that little test, whether ¼ screen, normal screen or full screen.
Any chance you're not actually running the newer image? That's one problem with updating something and having to make it look exactly like the old thing - how do you tell?
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

### Re: Scratch 2.0 is out 9th May

I get a consistent 1.6/7 secs for that little test, whether ¼ screen, normal screen or full screen.
What do you get on the last asb updated image - do you get diffs between 1/4,normal and full screen?

Is there a way of inspecting something in the image I think I'm running (I'm no squeak expert but is there a procedure or something that I could check to see if its the right one?)

You are running at standard 700MHz?

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

timrowledge
Posts: 1286
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

### Re: Scratch 2.0 is out 9th May

My Raspbian Pi is not over clocked at all (at least not by me).

The changes I've been making have some curiously different effects between RISC OS and Raspbian; for the Asteroids game they make about a 4x difference to the frame-rate in both OSs, but for the big PacMan project I previously mentioned RISC OS gets 2x faster and Raspbian only ~1.5x. Also under Raspbian the Asteroid game shows a strange 'speed pulsing' effect that doesn't appear under RISC OS - the asteroids seem to scurry then hesitate, scurry some more etc. Obviously I'm going to have to investigate that sometime.

I did have some suspicions about the sound driver being responsible but some hacking to completely turn off the sound drivers in Squeak showed no change, so obviously not the problem.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

### Re: Scratch 2.0 is out 9th May

I wonder if we could get a baseline agreement between us on standard Raspbian image

Asteroids - medium window - 3.6 secs to fire into bottom right corner
1.6 secs in full screen

this is with ship sprite code showing

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

timrowledge
Posts: 1286
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

### Re: Scratch 2.0 is out 9th May

Asteroids - medium window - 3.6 secs to fire into bottom right corner
1.6 secs in full screen
Odd - on my Pi the times are very much the same for medium/full-screen.

I actually video'd the original image and my modified one with my iPhone to try to get a better timing - old image ~ 3.5s, new ~1.6, again pretty much the same whatever the display setting.
I even tried turbo mode to see the effect with some actual timing -
old image ~1.6, full-screen ~1.7
new image ~0.5, full-screen ~0.7

There should be a little more to come if a new VM build can be used since I added a very fast pixel-peek primitive that speeds up some of the 'am I touching' type operations; on RISC OS it was well worth it. There are some more complex 'is this colour touching that colour and is it a full moon next thursday unless it is raining' tests that should be massively improveable too.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

Return to “Scratch”