This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#6151 2012-11-14 01:22:29

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hey, does anyone live in or near Tokyo?  I'm taking this tour of Japan in May, and it strangely spends just one night in Tokyo on the way to the flight home, but I'd like to stay a few days at least; there seem to be at least a dozen art museums.  But I'm nervous about the impression I have that Japan is the last place left on earth where non-native-language-speakers have a really hard time.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6152 2012-11-14 09:03:24

MMSequeira
Scratcher
Registered: 2010-01-04
Posts: 26

Re: BYOB 3 - Discussion Thread

Is the

(clone)
block available in Snap! 4.0? I couldn't find it.

Offline

 

#6153 2012-11-14 09:06:12

MMSequeira
Scratcher
Registered: 2010-01-04
Posts: 26

Re: BYOB 3 - Discussion Thread

Anyone here with experience using Snap! 4.0 in the classroom? I'm thinking about switching from 3.1.1 to 4.0 and would very much appreciate your thoughts about this change. Have you done it? How did it go? What problems did you find? How did you solve them?

Offline

 

#6154 2012-11-14 11:32:37

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: BYOB 3 - Discussion Thread

MMSequeira wrote:

Is the

(clone)
block available in Snap! 4.0? I couldn't find it.

Theres no object orientation yet


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#6155 2012-11-14 11:39:34

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

MMSequeira wrote:

Is the

(clone)
block available in Snap! 4.0? I couldn't find it.

It'll be in 4.1, but for now we're putting our priority on things like the cloud back end.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6156 2012-11-14 11:44:28

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

MMSequeira wrote:

Anyone here with experience using Snap! 4.0 in the classroom? I'm thinking about switching from 3.1.1 to 4.0 and would very much appreciate your thoughts about this change. Have you done it? How did it go? What problems did you find? How did you solve them?

4.0 still has a few rough edges; for example only as of today can we generate musical notes, and only in Safari.  (The HTML5 feature we need is new and not all browsers have caught up.)

But by far the worst problem is saving to localstore, which means that the project isn't available as an ordinary file.  We have the export-as-XML workaround, but it's too awkward to inflict on kids, I think.

Other than that, 4.0 is already both way faster and more reliable than 3.1.1, and I use it whenever I can.

PS  My experience is with a handful of kids, grades 5-8, not a whole class.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6157 2012-11-14 13:20:47

MMSequeira
Scratcher
Registered: 2010-01-04
Posts: 26

Re: BYOB 3 - Discussion Thread

I've just tried to implement quicksort using Snap! 4.0. It is a bit slow... :-) Perhaps a sort block for lists would be appropriate? What about support for maps/hashes?

Offline

 

#6158 2012-11-14 14:22:41

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

MMSequeira wrote:

I've just tried to implement quicksort using Snap! 4.0. It is a bit slow... :-) Perhaps a sort block for lists would be appropriate? What about support for maps/hashes?

Did you put a wrap around it?

Offline

 

#6159 2012-11-14 14:42:25

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

MMSequeira wrote:

I've just tried to implement quicksort using Snap! 4.0. It is a bit slow... :-) Perhaps a sort block for lists would be appropriate? What about support for maps/hashes?

We are trying not to include as primitive anything that learners could write for themselves.  The goal is that they be able to see both above and below abstraction barriers.

Without seeing your code, I'm guessing that you combine functional and imperative list blocks on the same list.  That'd slow things down.  Either stick to the Scratch-style list blocks or stick to the Lisp-style ones.

But if I really wanted to sort a list quickly in Snap!, I'd use mergesort.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6160 2012-11-14 14:43:30

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

roijac wrote:

Did you put a wrap around it?

Roijac means "warp."   tongue


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6161 2012-11-14 17:34:07

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

What you really want is a Chinese translation of a programming language with primitives like "Where is the lavatory?"

Cèsuǒ zài nǎr ma?  big_smile
This is possibly the only phrase in Mandarin that I've retained from Rosetta Stone...


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#6162 2012-11-14 17:51:18

MMSequeira
Scratcher
Registered: 2010-01-04
Posts: 26

Re: BYOB 3 - Discussion Thread

bharvey wrote:

We are trying not to include as primitive anything that learners could write for themselves.  The goal is that they be able to see both above and below abstraction barriers.

I see your point. But there is a balance here. Some tools are really useful to allow students to quickly develop interesting stuff. Perhaps the solution would be to include sorting in the tools (I suppose they are available for Snap! 4.0).

bharvey wrote:

Without seeing your code, I'm guessing that you combine functional and imperative list blocks on the same list.  That'd slow things down.  Either stick to the Scratch-style list blocks or stick to the Lisp-style ones.

But if I really wanted to sort a list quickly in Snap!, I'd use mergesort.

Not really. Besides indexing, I use replace for the swaps. I use my own loops (repeat [script] while <predicate>), though, as well as recursion. I'm to new to BYOB/Snap! to really have a feel for what works or does not work. I may share the project here, if you think you may spend a few minutes looking at it. What's the usual way to share Snap! 4.0 projects here? A long URL?

Offline

 

#6163 2012-11-14 18:00:11

MMSequeira
Scratcher
Registered: 2010-01-04
Posts: 26

Re: BYOB 3 - Discussion Thread

bharvey wrote:

roijac wrote:

Did you put a wrap around it?

Roijac means "warp."   tongue

I did not! Way to go! It is *much* faster! Thanks a lot! But what exactly does it do?

Offline

 

#6164 2012-11-14 18:02:52

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

MMSequeira wrote:

What's the usual way to share Snap! 4.0 projects here? A long URL?

That'd be fine, or a URL to somewhere you can host the XML.

The plan is that anyone can make their own tool libraries, in addition to ours, so your students can have whatever you think they'll need.  The tools in snap.b.e/run are my theory about the minimum needed for usability, and the ones we want in place for teaching the BJC curriculum, but we're still arguing about it; Jens thinks it should load with no preloaded tools.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6165 2012-11-14 18:15:33

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

MMSequeira wrote:

But what exactly does it do?

It's like "atomic" in BYOB.  Whatever's inside the warp block runs without interruption until it's done (so, in particular, nothing will be displayed on the stage until it's done).


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6166 2012-11-14 18:20:12

MMSequeira
Scratcher
Registered: 2010-01-04
Posts: 26

Re: BYOB 3 - Discussion Thread

bharvey wrote:

MMSequeira wrote:

What's the usual way to share Snap! 4.0 projects here? A long URL?

That'd be fine, or a URL to somewhere you can host the XML.

The plan is that anyone can make their own tool libraries, in addition to ours, so your students can have whatever you think they'll need.  The tools in snap.b.e/run are my theory about the minimum needed for usability, and the ones we want in place for teaching the BJC curriculum, but we're still arguing about it; Jens thinks it should load with no preloaded tools.

Thanks! What are continuations, by the way?

As to tools, well, I guess the solution is, as you implied, to keep Snap! 4.0 minimal. Using warp :-), I guess I can solve my own problem providing students with whatever tools I think are useful in my context.

Of course, it would be great to have some way to share tools/libraries. The problem I see with that right now is that I use Snap! 4.0 localized to Portuguese. It is great for at least two reasons. First, it makes clear that English is a good language for developers simply because it is today's lingua franca, not because it is somehow specially suited for use in the keywords of programming languages and the identifiers of the programs. Second, and especially, because it is one less barrier in the way of students. However... custom blocks are not localizable. It would be *really* nice if they were. With a bit of extra effort, I would be able to share my tools with you without having to maintain two separate projects.

Offline

 

#6167 2012-11-14 18:24:57

MMSequeira
Scratcher
Registered: 2010-01-04
Posts: 26

Re: BYOB 3 - Discussion Thread

bharvey wrote:

MMSequeira wrote:

But what exactly does it do?

It's like "atomic" in BYOB.  Whatever's inside the warp block runs without interruption until it's done (so, in particular, nothing will be displayed on the stage until it's done).

Really? My code (still) includes a few say blocks for tracing purposes. They all seem to go through. What am I missing?

By the way, Snap! 4.0 is single threaded? Where can I find a technical description of these issues?

Offline

 

#6168 2012-11-14 18:38:33

MMSequeira
Scratcher
Registered: 2010-01-04
Posts: 26

Re: BYOB 3 - Discussion Thread

So, when you "save" a project in Snap! 4.0 the URL is changed so that it includes the whole project, right?

Offline

 

#6169 2012-11-14 19:01:07

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: BYOB 3 - Discussion Thread

MMSequeira wrote:

So, when you "save" a project in Snap! 4.0 the URL is changed so that it includes the whole project, right?

That's correct. You can also choose "Export project…" from the File menu to export your project as a standalone XML file (you can save this more easily to your local drive if you need it there).


nXIII

Offline

 

#6170 2012-11-14 19:12:09

MMSequeira
Scratcher
Registered: 2010-01-04
Posts: 26

Re: BYOB 3 - Discussion Thread

Here's my quicksort version: https://docs.google.com/open?id=0B0aJYL … G9lalRucWc

Last edited by MMSequeira (2012-11-14 19:12:57)

Offline

 

#6171 2012-11-14 20:57:18

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

MMSequeira wrote:

What are continuations, by the way?

The continuation of a block in a script is the stuff that still has to be done after the block finishes.  In the case of a command block, this means the blocks below it in the script.  For a reporter block, the continuation includes plugging the reported value into the caller of the reporter as well as the stuff below it.

Like other Scheme dialects, Snap! allows a continuation to be used as data, in the form of a procedure that can be called, from an entirely different point in the computation, to carry out the continuation.  The continuation of a command is a procedure with no inputs; the continuation of a reporter is a procedure with one input, namely, the value that the continuation should use as the returned value from that reporter.

CALL W/CONTINUATION and RUN W/CONTINUATION take as input a procedure with one input.  That procedure isn't a continuation!  But it will be called with a continuation as its input.  Typically the procedure stores the continuation, maybe in a global variable, to be used by some other part of the program.  Look at the implementation of CATCH and THROW to see an example of using continuations.


Of course, it would be great to have some way to share tools/libraries.

Coming.  The initial release of our server will have only private storage of projects, but sharing will be added reasonably quickly.

The problem I see with that right now is that I use Snap! 4.0 localized to Portuguese...  However... custom blocks are not localizable.

Yup, good point.  Of course, in practice, you're not going to provide localization of your blocks into every other language!  So this will, I'm guessing, give English even more hegemony than it has already.  smile   But, yeah, we should provide a way to do that.  Maybe in version 4.2 or something.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6172 2012-11-14 21:14:20

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

MMSequeira wrote:

Really? My code (still) includes a few say blocks for tracing purposes. They all seem to go through. What am I missing?

Hmm, I learn something every day.  I guess SAY does a context switch to the display updater even inside a WARP.

By the way, Snap! 4.0 is single threaded? Where can I find a technical description of these issues?

Each running script is a thread.  Like Scratch, we make the management of those threads part of the interpreter's job, rather than relying on operating system threads.  The reason is that the switching between threads is done in a deterministic way, e.g., at the bottom of every looping construct like REPEAT.  Thus, if your program consists of two scripts:

WHEN FLAG CLICKED
FOREVER
   MOVE 10 STEPS

WHEN FLAG CLICKED
FOREVER
   TURN 15 DEGREES

what you get is a circle, not a random walk, because the MOVE and the TURN happen in strict alternation.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#6173 2012-11-15 02:55:03

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

even WARP-ed scripts yield once every 500 ms to update the display (e.g. in case they cause an error) and to allow user interaction, particularly with the red stop sign button. Also, interpolated ("timed") blocks like SAY, WAIT, PLAY NOTE, REST and all blocks named ... AND WAIT or ... UNTIL DONE break out of atomicity and will constantly yield even if inside a WARP block.

As Manuel correctly assumes, Snap! runs in a single OS thread. However, Snap's Morphic kernel is at its heart a timesharing multiplexer which schedules "green threads", thus basically providing its own little operating system. As Brian points out, this lets us implement threads nicely in Snap, but - maybe even more importantly - it enables a very direct, interactive and "lively" IDE. For example, it lets you click on running scripts to stop them, or it lets you drag things around, click buttons, change blocks and scripts and edit inputs while scripts are running, and even modify those scripts which are being executed "live".

Last edited by Jens (2012-11-15 07:26:26)


Jens Mönig

Offline

 

#6174 2012-11-15 06:50:43

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

MMSequeira wrote:

What are continuations, by the way?

The continuation of a block in a script is the stuff that still has to be done after the block finishes.  In the case of a command block, this means the blocks below it in the script.  For a reporter block, the continuation includes plugging the reported value into the caller of the reporter as well as the stuff below it.

Like other Scheme dialects, Snap! allows a continuation to be used as data, in the form of a procedure that can be called, from an entirely different point in the computation, to carry out the continuation.  The continuation of a command is a procedure with no inputs; the continuation of a reporter is a procedure with one input, namely, the value that the continuation should use as the returned value from that reporter.

CALL W/CONTINUATION and RUN W/CONTINUATION take as input a procedure with one input.  That procedure isn't a continuation!  But it will be called with a continuation as its input.  Typically the procedure stores the continuation, maybe in a global variable, to be used by some other part of the program.  Look at the implementation of CATCH and THROW to see an example of using continuations.

Here's another (longer and better) explanation by bharvey: http://scratch.mit.edu/forums/viewtopic … 05#p952305


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#6175 2012-11-15 07:48:23

MMSequeira
Scratcher
Registered: 2010-01-04
Posts: 26

Re: BYOB 3 - Discussion Thread

Thanks for explaining continuations! I'll study the blocks that use them.

bharvey wrote:

MMSequeira wrote:

The problem I see with that right now is that I use Snap! 4.0 localized to Portuguese...  However... custom blocks are not localizable.

Yup, good point.  Of course, in practice, you're not going to provide localization of your blocks into every other language!  So this will, I'm guessing, give English even more hegemony than it has already.  smile   But, yeah, we should provide a way to do that.  Maybe in version 4.2 or something.

I could share my tools in Portuguese and English. Other people might take them, add their own localization, and update the shared tools, so that now they would be available in another language. If sharing and managing versions of tools is available, interesting libraries would develop faster, with contributions from all over the world. Scratch/BYOB/Snap! are already strong in their support for other languages. It's just a small step from here. :-)

Offline

 

Board footer