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

#2426 2011-01-19 07:44:33

clintonhackers
Scratcher
Registered: 2010-04-27
Posts: 20

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Another experimental version!

Jens wrote:

this version experiments with Lieberman-style inheritance in variables and named lists (in addition to custom-block inheritance):

Thank you Jens, this looks amazing. Is there a 'clone me' or 'spawn' block that we can use in scripts?  I'm not seeing it but maybe I'm just being dense.

really looking forward to experimenting with this.

Matt

Offline

 

#2427 2011-01-19 07:45:47

clintonhackers
Scratcher
Registered: 2010-04-27
Posts: 20

Re: BYOB 3 - Discussion Thread

bharvey wrote:

titaniumbones wrote:

Wouldn't be great if "shoot" spawned a new "bullet" sprite, by passing a signal to 'bullet' that included x,y, and direction information?  Is this already possible?

Yup!  (Well, as soon as we can spawn sprites from a script at all.)

In the bullet sprite, define a for-this-sprite-only custom block NEW BULLET with inputs XPOS, YPOS, and DIRECTION.  This is where you put the CLONE ME block.  Then, in the gun sprite, you say

LAUNCH [<NEW BULLET> OF <BULLET>] WITH INPUTS <xpos> <ypos> <dir>

That's the OF block in the sensing menu.  First choose the sprite, then the local variables and blocks will appear in the dropdown on the left.

ah. great.  I completely missed 'launch'.  Thanks so much.

Offline

 

#2428 2011-01-19 07:47:03

clintonhackers
Scratcher
Registered: 2010-04-27
Posts: 20

Re: BYOB 3 - Discussion Thread

clintonhackers wrote:

bharvey wrote:

titaniumbones wrote:

Wouldn't be great if "shoot" spawned a new "bullet" sprite, by passing a signal to 'bullet' that included x,y, and direction information?  Is this already possible?

Yup!  (Well, as soon as we can spawn sprites from a script at all.)

In the bullet sprite, define a for-this-sprite-only custom block NEW BULLET with inputs XPOS, YPOS, and DIRECTION.  This is where you put the CLONE ME block.  Then, in the gun sprite, you say

LAUNCH [<NEW BULLET> OF <BULLET>] WITH INPUTS <xpos> <ypos> <dir>

That's the OF block in the sensing menu.  First choose the sprite, then the local variables and blocks will appear in the dropdown on the left.

ah. great.  I completely missed 'launch'.  Thanks so much.

I realize I'm logging in to the forum as both myself and my kids' computer club.  Sorry for any confusion!  we're both Matt (titaniumbones & clintonhackers).

Offline

 

#2429 2011-01-19 07:49:52

clintonhackers
Scratcher
Registered: 2010-04-27
Posts: 20

Re: BYOB 3 - Discussion Thread

bharvey wrote:

titaniumbones wrote:

I'm trying to figure out how to use BYOB in a computer club filled with 10-year-olds...
Has anyone else done anything like this before?

In my own group of 10-year-olds, a bunch really liked the idea of learning a cool new version that nobody else had yet (this was a year ago), but quickly cooled off when I told them they couldn't upload BYOB projects to the Scratch web site.  sad

But I'd be super interested to see anything in the way of curriculum that you invent!

well, we'll see.  I'm not particularly impressed with my pedagogical methods just yet. This year, though, I have 3 kids who've worked with me before, and a bunch of younger, much less advanced kids -- so I think the couple of the older kids might be up for trying something new.  The lack of a website is a huge drawback for them, though, I will certainly admit that.

Offline

 

#2430 2011-01-19 11:05:56

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

Re: BYOB 3 - Discussion Thread

clintonhackers wrote:

bharvey wrote:

Another experimental version!

Thank you Jens, this looks amazing. Is there a 'clone me' or 'spawn' block that we can use in scripts?  I'm not seeing it but maybe I'm just being dense.
Matt

Thanks, Matt! We're currently conducting some very preliminary "thought experiments" trying to whip up something to play with along the way. There will be some experimental blocks and other changes to the GUI soon, but it's all in flux and bound to change often, so it's probably best not to use these pre-alpha versions for any long-term projects yet. Other than that I'm thrilled to share development builds and listen to your thoughts on the issues we're discussing  smile  (e.g. prototype based inheritance for sprites)

Last edited by Jens (2011-01-19 11:07:21)


Jens Mönig

Offline

 

#2431 2011-01-19 12:47:17

titaniumbones
Scratcher
Registered: 2010-04-20
Posts: 8

Re: BYOB 3 - Discussion Thread

Jens wrote:

Thanks, Matt! We're currently conducting some very preliminary "thought experiments" trying to whip up something to play with along the way. There will be some experimental blocks and other changes to the GUI soon, but it's all in flux and bound to change often, so it's probably best not to use these pre-alpha versions for any long-term projects yet. Other than that I'm thrilled to share development builds and listen to your thoughts on the issues we're discussing  smile  (e.g. prototype based inheritance for sprites)

Well at the speed you guys are working I ought to be able to restrain my impatience -- things are moving so quickly! 
Overall, I am more or less seduced by Lieberman's paper, though I'm not entirely convinced by the cognitive arguments he makes about prototypes. 

Here's one question:  we've talked a lot about what happens when a user changes something in a clone.  What should happen when a user changes something in the prototype?  As a rotten programmer, I tend to work this way: 
- hack up a first draft.
- rashly make some copies
- realize an error, or a feature I would like to include
in class-based OOP, I would then go back and simply modify the parent class.  All my subclasses & instances would benefit from those changes.  In the current implementation, though, modifications made to a prototype don't seem to affect the clones.  Maybe it shouldn't; but the kids who are *one* audience for BYOB are like me insofar as they are constantly and forgetfully updating their code.  One fantastic feature of BYOB is the ability to put crucial bits of code into functions that can then be modified one time for all sprites.  It seems to me of practical utility to have the same kind of framework for sprite families -- though it may contravene some of the Lieberman-inspired design principles. 

So far so great.  I'm really looking forward to 3.1 & all the intermediate steps.  Thanks as always for a great tool,
matt

Offline

 

#2432 2011-01-19 13:36:47

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: BYOB 3 - Discussion Thread

BYOB is really cool!
I have 3.0.8 but i'd like to compare with older versions.

Offline

 

#2433 2011-01-19 13:59:20

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

Re: BYOB 3 - Discussion Thread

titaniumbones wrote:

What should happen when a user changes something in the prototype?

The exact details are still under discussion, but the broad principles are

1.  It will be possible for prototype and children to share a common value, so that changes in the prototype will be seen by the children.  Custom blocks will almost certainly behave this way by default.

2.  It will be possible for prototype and children to have separate values for the same named thing.  System attributes such as position and heading will very likely behave this way by default.

3.  To some extent it will be possible for the user to control which of those two conditions applies to any particular attribute of a sprite.  We are still feeling out the details on this point.  For example as of this moment we are in disagreement about whether a child should be able to change the value of a variable seen by its prototype (and therefore its siblings).

But don't worry -- based on the 3.0 experience, Jens and I will be having arguments the day before the release, and it'll nevertheless turn out to be something we're both proud of.  smile


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

Offline

 

#2434 2011-01-19 14:02:14

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

Re: BYOB 3 - Discussion Thread

scimonster wrote:

I have 3.0.8 but i'd like to compare with older versions.

How much older?  3.0.7?  2.99?  2.0?


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

Offline

 

#2435 2011-01-19 14:27:57

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

scimonster wrote:

I have 3.0.8 but i'd like to compare with older versions.

How much older?  3.0.7?  2.99?  2.0?

maybe the original!

Offline

 

#2436 2011-01-19 15:00:50

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

Re: BYOB 3 - Discussion Thread

scimonster wrote:

maybe the original!

Okay, start here: http://www.chirp.scratchr.org/blog/?m=200810


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

Offline

 

#2437 2011-01-19 20:29:47

14God
Scratcher
Registered: 2008-11-14
Posts: 100+

Re: BYOB 3 - Discussion Thread

I think class based OOP is less confusing because it allows the class to not have to be an object that exist at any given moment and gives a feeling of officialness and organization. I guess I'm just saying that it makes an object seem less like 'just a copy'. Also it seems confusing for variable inheritance to come from the instance parent instead of a list of default values for a class because one of the connotations of something being an object is that it is solid, self sufficient and not connected to something else, otherwise those two connected objects would be one object.

P.S. I have no idea if I'm getting my point across because I'm a horrible communicator.


http://cs.berkeley.edu/~bh/sig4.png
Logic and reason have led me to atheism... but I'm stuck with the name  tongue

Offline

 

#2438 2011-01-19 20:41:14

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: BYOB 3 - Discussion Thread

14God wrote:

I think class based OOP is less confusing because it allows the class to not have to be an object that exist at any given moment and gives a feeling of officialness and organization. I guess I'm just saying that it makes an object seem less like 'just a copy'. Also it seems confusing for variable inheritance to come from the instance parent instead of a list of default values for a class because one of the connotations of something being an object is that it is solid, self sufficient and not connected to something else, otherwise those two connected objects would be one object.

P.S. I have no idea if I'm getting my point across because I'm a horrible communicator.

I'm going to put your point in a couple of bullets:

*Class based OOP allows that an object doesn't have to exist at any given time, adding convenience.

*It gives a feel of organization and standardization.

*Variable inheritance makes "objects seem like one"
    -Objects should be solid, self sufficient, and not relying on another.
    -Without it, the objects seem like one.


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#2439 2011-01-19 21:13:06

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

Re: BYOB 3 - Discussion Thread

14God wrote:

I think class based OOP is less confusing because it allows the class to not have to be an object that exist at any given moment and gives a feeling of officialness and organization.

I think the point about "officialness" does capture the main difference between class/instance OOP and prototyping OOP.  Class/instance works great if, before you do any actual programming at all, you carefully plan out an object hierarchy with all the necessary pieces.  Prototyping is much better for "bricolage" (Papert) or tinkering -- the sort of thing people actually do in Scratch!  It's definitely a very different style of work.  Since I'm a tinkerer myself (my colleague Mike Clancy characterizes my programming style as "debugging a blank piece of paper"  smile  ) I'm a big fan of prototyping.

If you really want classes, all you have to do is make a sprite and hide it!  It'll act as your class.

Also it seems confusing for variable inheritance to come from the instance parent instead of a list of default values for a class because one of the connotations of something being an object is that it is solid, self sufficient and not connected to something else, otherwise those two connected objects would be one object.

Oh, I disagree with this!  Class/instance OOP has inheritance, too; it's vital for code reuse.  And the classes can provide class variables, which allow siblings to interact -- to be "connected" without being one object.  The details are different but you can't build an object system without inheritance in some form.

I think that people who've learned Java or C++ or some such language have just developed particular ways to think about OOP, but they aren't laws of nature.  I'm betting that OOP-naive Scratch users will understand prototyping more easily than class/instance OOP, because with prototyping nothing is invisible, the way classes are.  One of the Scratch design goals was to keep everything visible on the stage.

We're still in pre-alpha, bear in mind, so I think the final product will look much smoother to you than what we're playing with right now.  Have faith for a while.  smile


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

Offline

 

#2440 2011-01-20 05:45:09

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

@Brian and Jens - You are our Dream Team !!

Duplication works fine. But I don't understand the meaning of "spawn" and "prototype" selection choices.

Our discussion around instance/delegation issues should make us forget that OOP languages, whichever there are, are successful because thay are particularly well adapted to the "tree structures" which populate our real world.For example :

- a Web HMI interface is composed of a screen, itself composed of several windows, each window is composed of position and size propertiesa , of one rectangle itself composed of text/image, title, sliders etc, of a border having its own properties (width, color). OOProgrammer needs to handle the relationships existing betweeen all the windows components by the mean of events : If a choice button is clicked then one action is executed, if the window is moved all its components must move together).

- one adventure game is composed of several scenes, each one composed of buildings (or forest, or dungeon, or shops), composed of characters (heros, enemies, merchants, monsters) each one owning specific properties (strength, wealth, position), and owning objects (commodities, weapons, poison or life elixir). The action is set by many events defining the relations between all these actors (or objects in OOP vocabulary)

- same remark for the elephant of H. Liebermann : an elephant may also be considered as composed many parts, each having its own properties (color, size..) and motion. When the elephant moves all its parts move at the same pace, even if each part of its body has its own specific  "relative" motion.

I remember that once upon a time a sprite cloning feature was implemented in Byob ( with one example of a moving motor engine). I wonder if this is not a way to explore further on in line the new developments of Jens (Morph for Ipad ).

Offline

 

#2441 2011-01-20 05:46:45

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

"should NOT make us forget"

Offline

 

#2442 2011-01-20 09:33:49

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

Re: BYOB 3 - Discussion Thread

Hi Xavier,

I absolutely agree with you about the power, beauty and ubiquity of compositional relationships as in Morphic or in the HTML DOM. In fact, I would go so far as to claim that object nesting is way more important and powerful than inheritance, especially regarding the way in which spatial, visual and sensoric "traits" are propagated from the composite down to its parts.

The good news is that nested sprites have been in BYOB since version 2.0, but subtly hidden in the GUI, not well documented, and not supported by blocks. But this is going to change in the next official release.

The nested sprites examples of engines and toads are part of the regular BYOB distribution, but - lamentably - not documented at all. In the current official release such nested sprites cannot be cloned (duplicated) including their parts in the BYOB Window itself, instead exporting a composite exports the whole thing, and importing such a sprite accomplishes the task of duplicating the whole.

Again, I'm planning for the next official release to make this much easier and more intuitive to use.

Thanks!


Jens Mönig

Offline

 

#2443 2011-01-20 12:17:39

14God
Scratcher
Registered: 2008-11-14
Posts: 100+

Re: BYOB 3 - Discussion Thread

What if you want to spawn a bullet from a gun not a bullet? And if variables are inherited from the spawning instance instead of the class defaults, what if a 'goat' instance spawns another goat... and its age variable is 10, shouldn't the child goats age be 0? and shouldn't that be implied not user implemented? (I'm sorry, think there are valid arguments on both sides, class and prototype. It's just because I'm new to the concept and am somewhat 'shy'  wink  )

bharvey wrote:

Have faith for a while.  smile

ok  smile

btw- will prototyping still allow me to say something like "object.isa('class name')" ?


http://cs.berkeley.edu/~bh/sig4.png
Logic and reason have led me to atheism... but I'm stuck with the name  tongue

Offline

 

#2444 2011-01-20 13:50:39

14God
Scratcher
Registered: 2008-11-14
Posts: 100+

Re: BYOB 3 - Discussion Thread

@Bharvey || Jens
Will there be a hierarchy browser?


http://cs.berkeley.edu/~bh/sig4.png
Logic and reason have led me to atheism... but I'm stuck with the name  tongue

Offline

 

#2445 2011-01-20 22:39:21

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

Re: BYOB 3 - Discussion Thread

Another day, another experimental version!

Jens wrote:

This experimental version introduces first class sprites in addition to prototype based inheritance of sprite-only variables, lists and custom blocks. There is a new reporter block in the Control category with a drop-down menu which answers the object (sprite or stage) indicated by the name in the drop-down. You can store and retrieve objects in variables and lists (try stage watchers on such variables and lists, and double-clicking on sprite-reporters!), pass them to blocks which (now) accept sprite arguments (try SAYing a sprite) and create new sprites by spawning existing ones. There are also some experimental blocks to play with, and the basics of the file format are also in place.

The tricky part is getting a clone to do something programmatically, this part (the OF block) is still very much under construction. And this isn't anywhere near functional. There are lots loose ends (so please don't report any bugs in Bugzilla about this version  smile  ), because these features required major internal changes, which will yet take a while to complete.

Otherwise, enjoy!
--Jens


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

Offline

 

#2446 2011-01-20 22:55:54

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

Re: BYOB 3 - Discussion Thread

14God wrote:

What if you want to spawn a bullet from a gun not a bullet?

Why would that make sense in a class/instance system?  It's like saying "what if I want something to be an instance of class Gun, but actually be a Bullet?"

What you probably really want to do is attach the bullet to the gun.  This is a geometrical relationship, not an object hierarchy relationship.  And, as Jens says, you can do that with the BYOB nesting feature -- although, Jens, we should really have a way to nest and unnest sprites from a script, not just from the GUI.

And if variables are inherited from the spawning instance instead of the class defaults, what if a 'goat' instance spawns another goat... and its age variable is 10, shouldn't the child goats age be 0? and shouldn't that be implied not user implemented?

Well, yeah, an AGE variable probably should start at 0.  But if, say, goats come in colors and you spawn a blue goat, all else being equal, the clone's COLOR should probably start at blue, rather than, I don't know, transparent or orange.  My point is that the desired behavior will be different for different variables, depending on the details of your project.  So there will be a default behavior, but part of designing a prototype will involve writing the WHEN CREATED script that initializes those variables for which the programmer wants something other than the default.

(I'm sorry, think there are valid arguments on both sides, class and prototype. It's just because I'm new to the concept and am somewhat 'shy'  wink  )

That's okay, I'm happy to argue.  smile   Nobody's going to get mad at you.

btw- will prototyping still allow me to say something like "object.isa('class name')" ?

Sure, except that instead of "class name" it'll be a prototype object.  It's sort of "is like" rather than "is a"; "this new object IS LIKE this other one."

Will there be a hierarchy browser?

One way or another.  Perhaps it won't look like a Smalltalk browser.  We're thinking about a "3-D" sprite corral where the clones of a given prototype are hidden behind it, so where it now says "Sprite43" it'll say "Sprite43 and 15 clones" and when you click on "clones" you see a little subcorral where all the clones (including maybe hidden clones of a clone) live.  We don't have all the UI details worked out yet.


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

Offline

 

#2447 2011-01-21 00:14:19

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

Re: BYOB 3 - Discussion Thread

bbbeb wrote:

I don't have much free time anymore. I hate school.

Yeah, me too!  Both halves.


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

Offline

 

#2448 2011-01-21 08:14:08

clintonhackers
Scratcher
Registered: 2010-04-27
Posts: 20

Re: BYOB 3 - Discussion Thread

bharvey wrote:

bbbeb wrote:

I don't have much free time anymore. I hate school.

Yeah, me too!  Both halves.

hmm.  and here I *love* school.  both halves.

Offline

 

#2449 2011-01-21 08:26:37

clintonhackers
Scratcher
Registered: 2010-04-27
Posts: 20

Re: BYOB 3 - Discussion Thread

bharvey wrote:

titaniumbones wrote:

What should happen when a user changes something in the prototype?

The exact details are still under discussion, but the broad principles are

1.  It will be possible for prototype and children to share a common value, so that changes in the prototype will be seen by the children.  Custom blocks will almost certainly behave this way by default.

2.  It will be possible for prototype and children to have separate values for the same named thing.  System attributes such as position and heading will very likely behave this way by default.

3.  To some extent it will be possible for the user to control which of those two conditions applies to any particular attribute of a sprite.  We are still feeling out the details on this point.  For example as of this moment we are in disagreement about whether a child should be able to change the value of a variable seen by its prototype (and therefore its siblings).

when you talk about attribute values, do you mean just variables or also scripts?  It was scripts in particular that was worrying me here -- because I;ll write a script which seems to work, clone a sprite once or twice, then realize the script is a little bit broken.  It's nice in that case not to have to copy the script for each cloned sprite...  At least I htink my kids would feel that way as much as I do. 
One thing that confuses me about protoyping is how to handle the specificity of the prototype.  So if Fred is your prototypical elephant, you can then define another elephant Clive, who is "like Fred, but different in particulars x, y, x".  And all subsequent elephants can be similarly defined.  But what if you realize that there are some things about Fred that you had imagined were generalities, but are actually really specific to him? Could you, for instance, "reparent" Clive and the other hundred elephants, and define a Fred derived from the new prototype? Thinking about this cognitively:  it may be the case that we arrive at abstract categories through particulars, but I think it's the case that our sense of categories shifts over time -- and that, for instance, I may have started out using Elrond as my prototypical elf but as I read broadly in the history of English, Nordic, and Celtic mythology, I came to think of elves as generally sinister and dangerous.  So Elrond has been gradually displaced as the prototype.*  It seems to me the prototyping leaves you with some tircky issues when that kind of evolution takes place.

[*sorry, we were watching Two Towers last night with the kids...]

Offline

 

#2450 2011-01-21 12:06:04

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

Re: BYOB 3 - Discussion Thread

clintonhackers wrote:

when you talk about attribute values, do you mean just variables or also scripts?

I agree that it's important for children to share the prototype's scripts, not just copies of them.

What worries me a little is how to allow for exceptions, supposing we want to do that.  So far in BYOB, scripts in the scripting area are not first class; you can't pick up such a script and use it as input to a block.  For most purposes, up to now, it's been good enough to wrap THE SCRIPT around scripts that we want to use as data -- but up to now we haven't had to worry about sharability.  And you can't wrap THE SCRIPT around a script that includes a hat block.  So I think we have some design work to do here.

But what if you realize that there are some things about Fred that you had imagined were generalities, but are actually really specific to him? Could you, for instance, "reparent" Clive and the other hundred elephants, and define a Fred derived from the new prototype?

Ah, great!  I keep asking Jens, "under what circumstances would anyone ever want to change the prototype of a child" and he keeps forgetting to answer.  smile   But that's a good example, and luckily, there's that "prototype" menu entry in the sprite corral menus to handle it.  There isn't a block, yet, but there aren't blocks for lots of things; we know we have to fix that.  I don't think there will be a specific REPARENT block; instead we'll make it work so you can say

Code:

FOR EACH ITEM OF [CHILDREN]
   SET [<PROTOTYPE> OF < >] TO <generic-elephant>

using the existing SET and OF blocks.

But, in your scenario you don't have to reparent the other elephants.  You can just ask each of the other elephants to SET <ORIENTATION> TO <EVIL> and put the same thing in the WHEN CREATED script for new elephants.  We should be sure both ways work.


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

Offline

 

Board footer