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

#2276 2011-01-05 16:45:37

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Jens wrote:

Morphic framework for browser-based JavaScript

Hi gang, recently I have been working on a new HTML5 based Morphic framework for web browsers called morphic.js, which might serve as a platform for BYOB4 or someting similar (yeah, it does work on the iPad). I just finished the documentation and released it under a free and open source MIT license. If you're interested you're invited to check it out at:

  http://www.chirp.scratchr.org/blog/?p=34

it's a blog post with a link to a live Morphic web page that looks and feels a lot like the Squeak version Scratch is written in, plus a video showing some tricks.

This is the very beginning of what might eventually turn out to be a complete re-write of BYOB...

This is really, really amazing. Great job!


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#2277 2011-01-05 16:59:14

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

that is amazing!

Offline

 

#2278 2011-01-05 17:13:12

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Wow. Clearly in my absence I've missed a bit. I'll take a look at Jen's project...
EDIT: It's GREAT! I can't wait to see BYOB there (I know it's in the distance future but none-the-less...)!

Last edited by shadow_7283 (2011-01-05 19:24:28)

Offline

 

#2279 2011-01-05 18:39:11

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Jens wrote:

Morphic framework for browser-based JavaScript

Hi gang, recently I have been working on a new HTML5 based Morphic framework for web browsers called morphic.js, which might serve as a platform for BYOB4 or someting similar (yeah, it does work on the iPad). I just finished the documentation and released it under a free and open source MIT license. If you're interested you're invited to check it out at:

  http://www.chirp.scratchr.org/blog/?p=34

it's a blog post with a link to a live Morphic web page that looks and feels a lot like the Squeak version Scratch is written in, plus a video showing some tricks.

This is the very beginning of what might eventually turn out to be a complete re-write of BYOB...

Wow... I looked at it expecting a rectangle and maybe a string morph but there is the whole base for a new program! Then I looked at the source which I thought would be a few hundred lines of code, but... 5000!!! WOW! You HAVE be busy!  big_smile


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#2280 2011-01-05 23:04:34

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

Re: BYOB 3 - Discussion Thread

This is...incredible! Wow, wow, wow, wow! Words cannot describe how impressed I am. It's really polished and it works perfectly. I'd love to see a BYOB built off of this.


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

Offline

 

#2281 2011-01-06 03:27:56

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

Re: BYOB 3 - Discussion Thread

Thanks, guys!

Actually creating a Morphic UI for JavaScript wasn't all that hard, because Morphic has been around for a long time, co-invented and pioneered by Scratch's very own lead developer John Maloney for the SELF programming language, an offshot of Smalltalk. JavaScript in turn is a hybrid of Scheme and SELF. So, it's been a proven concept for more than 15 years.

As I'm about to resume work on the next version of (Squeak based) BYOB 3 there is enough time for you to aquaint yourselves with the framework and - contribute!

If anyone is interested in contributing, here are some things you might try looking into:

   - extending CursorMorph (for multi-line editing and text selection)
   - tooltips
   - turtles (sprites with pen trails)
   - a "virtual keyboard" for text entry on touch screens

The last item ("virtual keyboard") is probably the easiest to begin with. And if you have any questions, don't hesitate to ask.

Last edited by Jens (2011-01-06 03:28:46)


Jens Mönig

Offline

 

#2282 2011-01-06 05:49:09

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

The virtual keyboard is in Squeak version? Or html version

Offline

 

#2283 2011-01-06 06:58:31

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

Re: BYOB 3 - Discussion Thread

@Jens

Words are missing to describe this giant lap you are accomplishing.
.
As far as I'm concerned, on one hand I could have feared that your new involvement  would not leave much time to support Byob. But on the other hand I must admit that, programming daily with Byob, it is now perfectly stable and reliable, with no bug or any teasing issue. Accomplishment of your new project will not leave behind orphan Byobers !

Good luck !

As far as morphic.js I've had an eye on the demo of DesignBlocksJS, similar to Scratch/Byob and was impressed by the speed of applications. I hope that Byob4 will run like that in the future.

Offline

 

#2284 2011-01-06 11:06:35

JTxt
Scratcher
Registered: 2010-05-19
Posts: 100+

Re: BYOB 3 - Discussion Thread

morphic.js is crazy impressive Jens.  I'm looking forward to the progress and what will be built on it.  I'll have to dig into it.


http://scratch.mit.edu/static/icons/buddy/524717_med.png?t=2010-06-15+09%3A48%3A36

Offline

 

#2285 2011-01-06 16:53:36

Shadowed1
Scratcher
Registered: 2010-01-19
Posts: 100+

Re: BYOB 3 - Discussion Thread

Could someone help me with a block I've been making?
(i'll just type it because a picture of it won't save because it's read only)

word 'number' of 'block'
script variables 'process letter' 'final word'
set process letter to 1
delete all of 'list letters'
repeat 'number'
[delete all of 'list letters'
[change process letter by 1
[add 'letter 'process letter' of 'block'' to 'list letters'
-----------------------------------------------------------------------
set 'final word' to 'list letters' as text
report 'final word'

When I try it as saying word 2 of answer, it says 'letters' If I'm doing something wrong or I've completely misunderstood a block, please tell me (BTW I'm new to BYOB)

Last edited by Shadowed1 (2011-01-06 17:02:23)


*Insert some witty, funny or sarcastic comment here*

Offline

 

#2286 2011-01-07 01:14:30

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

Re: BYOB 3 - Discussion Thread

Shadowed1 wrote:

[add 'letter 'process letter' of 'block'' to 'list letters'

This would be easier with an actual picture, but I'm guessing that you actually said

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

and I'm guessing that you think that means "give me the list named 'letters'," but actually it means to create a new list that has no name, but has one element, the word "letters"!  What I think you meant to do was something like

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

Am I reading your mind correctly?  smile   The LIST block with no input slots (grab one from the palette and then click the left-facing arrowhead to eliminate its input slot) says "create a new list, with no name, and nothing in it."

P.S.  Also, I'm not sure what kind of thing "block" is, but if it's a text string, I can't work out how you're trying to divide it into words -- you should be looking for space characters or something.

P.P.S.  I don't know if you want to work this out for yourself or if you just want to see a solution, but in the latter case, look at the SENTENCE->LIST block in the tools project in the BYOB folder.  It does more or less what you're trying to do.

(BTW I'm new to BYOB)

Welcome!

Last edited by bharvey (2011-01-07 01:28:28)


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

Offline

 

#2287 2011-01-07 01:41:02

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

Re: BYOB 3 - Discussion Thread

xly wrote:

I could have feared that your new involvement would not leave much time to support Byob.

Don't worry, there will be a version 3.1 that'll be even better than 3.0!  smile   And Jens's Morphic in Javascript will (if all goes according to plan) provide the GUI for BYOB4, which will (if ditto) run existing BYOB projects, as well as add new features, but fast!  (Speed is the biggest problem with 3.0 -- that and the weak support for debugging.)

My guess (not a promise!) is that February will see another almost-daily series of 3.099 alpha-test releases converging on something I can show off March 11 at SIGCSE.  And after that comes the 4.0 development, with the final release in time for the Fall 2011 offering of CS 10 at Berkeley!

Today we've started arguing about how to do first class sprites.  smile


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

Offline

 

#2288 2011-01-07 02:38:10

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

Re: BYOB 3 - Discussion Thread

Just made a BYOB fan site with forums, project/custom blocks uploads, competitions and blogs. Please check it out and tell me of any bugs/potential improvements.

http://byobshack.weebly.com/


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

Offline

 

#2289 2011-01-07 04:43:24

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

xly wrote:

I could have feared that your new involvement would not leave much time to support Byob.

Don't worry, there will be a version 3.1 that'll be even better than 3.0!  smile   And Jens's Morphic in Javascript will (if all goes according to plan) provide the GUI for BYOB4, which will (if ditto) run existing BYOB projects, as well as add new features, but fast!  (Speed is the biggest problem with 3.0 -- that and the weak support for debugging.)

My guess (not a promise!) is that February will see another almost-daily series of 3.099 alpha-test releases converging on something I can show off March 11 at SIGCSE.  And after that comes the 4.0 development, with the final release in time for the Fall 2011 offering of CS 10 at Berkeley!

Today we've started arguing about how to do first class sprites.  smile

Are there plans for OOP in BYOB4?


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

Offline

 

#2290 2011-01-07 05:12:54

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

Re: BYOB 3 - Discussion Thread

14God wrote:

Are there plans for OOP in BYOB4?

Well, as Brian mentioned we're really planning to get some more OOP into BYOB 3.1  smile


Jens Mönig

Offline

 

#2291 2011-01-07 06:57:26

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

Re: BYOB 3 - Discussion Thread

Jens wrote:

14God wrote:

Are there plans for OOP in BYOB4?

Well, as Brian mentioned we're really planning to get some more OOP into BYOB 3.1  smile

Anyway, I think that Byob, as it is now, can be considered as a good paradigm of OOP : you can have sprites used as parent of different classes, you can duplicate each one to get new Members of these Classes, methods and local variables are also duplicated, you can play wih local/global variables and methods . Byob also offers a mean to handle properties of object-sprites (see Ch 4 of Brian Harvey Byob tutorial) . Byob is not so far from a full-fledged OOP language, but having in addition the advantage of its graphics interface which "shows" how OOP works practically better than typing a lot of instructions just to say that Dingo is a new object of the Class Dog, which barks.

Presently, when you create dozens of new sprites by duplicating a "master" class-sprite you need to do some typing to define : name of the new object-sprite, its local and global variables, set the methods etc (it  is useful to create a Global variable having the same name as the object-sprite, because this variable can be used as a parameter of many useful Byob instructions like <property OF sprite >, <distance TO >, broadcast etc).

All this typing could be simplified by having an instruction like DUPLICATE class-sprite TO object-name . We could also have a Byob instruction like : MAKE VARIABLE local-variable FOR object-name . By setting these instructions in a simple script (or C-shape) a new object could be easily created.

Offline

 

#2292 2011-01-07 13:32:05

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

Re: BYOB 3 - Discussion Thread

xly wrote:

Jens wrote:

14God wrote:

Are there plans for OOP in BYOB4?

Well, as Brian mentioned we're really planning to get some more OOP into BYOB 3.1  smile

Anyway, I think that Byob, as it is now, can be considered as a good paradigm of OOP : you can have sprites used as parent of different classes, you can duplicate each one to get new Members of these Classes, methods and local variables are also duplicated, you can play wih local/global variables and methods . Byob also offers a mean to handle properties of object-sprites (see Ch 4 of Brian Harvey Byob tutorial) . Byob is not so far from a full-fledged OOP language, but having in addition the advantage of its graphics interface which "shows" how OOP works practically better than typing a lot of instructions just to say that Dingo is a new object of the Class Dog, which barks.

Presently, when you create dozens of new sprites by duplicating a "master" class-sprite you need to do some typing to define : name of the new object-sprite, its local and global variables, set the methods etc (it  is useful to create a Global variable having the same name as the object-sprite, because this variable can be used as a parameter of many useful Byob instructions like <property OF sprite >, <distance TO >, broadcast etc).

All this typing could be simplified by having an instruction like DUPLICATE class-sprite TO object-name . We could also have a Byob instruction like : MAKE VARIABLE local-variable FOR object-name . By setting these instructions in a simple script (or C-shape) a new object could be easily created.

NOOOOOO!!!!! objects should not be duplicated they should be spawned from a library(the costume/sprite folder) OOP should be built in. It would be a very simple but compelling feature for newcomers to BYOB. BTW- there really should be a reporter block that reports the name of an object.


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

Offline

 

#2293 2011-01-07 13:33:12

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

Re: BYOB 3 - Discussion Thread

Jens wrote:

14God wrote:

Are there plans for OOP in BYOB4?

Well, as Brian mentioned we're really planning to get some more OOP into BYOB 3.1  smile

that would be awesome


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

Offline

 

#2294 2011-01-07 14:50:15

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

Re: BYOB 3 - Discussion Thread

14God wrote:

objects should not be duplicated they should be spawned from a library(the costume/sprite folder) OOP should be built in.

I think you are taking the word "duplicate" too literally.  Of course a cloned sprite should inherit changes made to its model.

Perhaps you are worried about a class/instance distinction?  But we are planning a prototype-style OOP language.  This is genuine OOP, but maybe not the way you're familiar with.  It fits better with the exploratory style of Scratch; people don't sit at a text editor writing a finished program and then run it through the compiler; they try things out, tinker with sprite behavior, and meanwhile want to have several sprites that behave the same way.  So we allow any object to serve as both a class and an instance -- it's an instance of its parent, and it's the class for its children.

This does raise the technical question of exactly what object properties should be inherited by the children.  For example, if you're making a breakout game, you've built a brick sprite, and you want a bazillion of them to make a wall, you want the children to inherit the shape and the methods of the parent, but not its position, probably.

Luckily we have a good model for a solution; long ago there was a language called Object Logo (it ran only on the Motorola 68000-based Macintosh; that's how old it is) that used prototyping and elegantly worked out all the details.  I think we should follow their lead pretty closely.

One big question in my mind is this:  Sprites are obviously objects, but other things might be considered objects, too, including systemy things we don't have yet such as disk files and text windows, and also including user-defined things ranging from hash tables to magic spells.  BYOB already has a way to do non-sprite OOP (see part IV, page 20 of the reference manual) but arguably if we're turning sprites into real objects there's no reason not to allow other kinds of objects.  (Counter-argument: users can just make them sprites that are always hidden.)

Anyway, don't worry, we're going to do the right thing.  smile


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

Offline

 

#2295 2011-01-07 15:43:37

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

This does raise the technical question of exactly what object properties should be inherited by the children.  For example, if you're making a breakout game, you've built a brick sprite, and you want a bazillion of them to make a wall, you want the children to inherit the shape and the methods of the parent, but not its position, probably.

this is the way unreal script handles it:
the inputs are:
1. class to spawn
2. what to name object (optional)
3. location (optional)
4. direction (optional)
(left out the inputs that wouldn't be relevant to BYOB)
If no name is given name the object ('class name' # x).
If no position or direction inputs are filled then inherit parents direction and position.


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

Offline

 

#2296 2011-01-07 17:19:14

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

Re: BYOB 3 - Discussion Thread

@ 14God

BTW- there really should be a reporter block that reports the name of an object.

May I suggest you to try this : make a global variable having the name of your sprite. Then you can use it as an item of a list or as a parameter of instructions like <Distance To spritename > Then any  block can report this name or a list of names. For example when you find all sprites contained into a circle centered on a given sprite.

Offline

 

#2297 2011-01-07 17:37:29

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

Re: BYOB 3 - Discussion Thread

@ bharvey - Refering to Object Logo on Macintosh.

This Logo was derived from the "Object Lisp" initially created to be implemented on (few ) dedicated Lisp-Machines. When the first big Macintosh arrived (I don't remember its name )Object Lisp was directly ported on Macintosh. Later on it became "Object Logo". The Lisp-Machines have been the first (and probably the last) machines entirely based on OOP language and concepts... 30 years ago !!!

Offline

 

#2298 2011-01-07 20:06:34

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

Re: BYOB 3 - Discussion Thread

xly wrote:

When the first big Macintosh arrived (I don't remember its name )Object Lisp was directly ported on Macintosh. Later on it became "Object Logo".

Umm, it's true that Object Logo was (partly) written in Lisp, but I don't think "became" is quite right -- there was a year's worth of design meetings and alpha releases before Object Logo came out.  The OOP design in Object Logo wasn't much like the one in Lisp Machine Lisp!

The Lisp-Machines have been the first (and probably the last) machines entirely based on OOP language and concepts... 30 years ago !!!

No, the first and last machine entirely based on OOP was the Xerox Alto, running Smalltalk.  Lisp Machine Lisp did have some OOP ideas in it (iirc with a strange metaphor about "flavors" and "mixins" because of the proximity of Steve's Ice Cream, whose specialty was mixing things like candy or nuts into your ice cream to order), but Lisp was and is still primarily about functional programming, not about OOP.


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

Offline

 

#2299 2011-01-07 20:23:03

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

Re: BYOB 3 - Discussion Thread

14God wrote:

1. class to spawn
2. what to name object (optional)
3. location (optional)
4. direction (optional)

Sprites have many more properties than just position and heading.  They have costumes, sounds, colors, sizes, special graphics effects, pen state (up/down, color, size), and I'm sure I'm forgetting even more.  And besides those things that all sprites have, particular sprites can have user-created variables and methods.

I think method inheritance will be straightforward; the child sees changes made in the parent, unless the child explicitly shadows the method (by editing it in the child).  Parents don't see changes made in children.

All the other ones are trickier.  Most of the time users will want all the built-in sprite state attributes to be separate in parent and child, so if the parent changes color, the child doesn't.  But sometimes people will want a dozen things on the screen that all have the same color -- when one changes, so do the others.

In Object Logo, when you create an instance by saying ONEOF <object>, the new object shares all state with its parent, but it automatically runs an EXIST method (this is like the "when cloned" hat block in Panther) that typically has a lot of instructions like

HAVEMAKE "FOO :FOO

which means "create a new instance variable named FOO and give it the same value I inherited from my parent," i.e., thereafter, changes in the parent's variable aren't seen by the child.  This gives the user complete control over what's shared and what isn't, but it means that the default is to share, which may not be the right thing for BYOB.  We're going to have to decide about that.

P.S. About names, sprites should be first class, which means that instead of having a name input to the CLONE method, you'll just be able to say

SET <variable> TO [CLONE <sprite>]

or maybe

SET <variable> TO [CALL [[CLONE] OF <sprite]]

But this does raise the question of whether or not a clone should appear in the sprite corral (down in the bottom right corner).  Pro: How else do you edit a child?  Con: There may be an awful lot of them.


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

Offline

 

#2300 2011-01-07 21:29:29

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

Re: BYOB 3 - Discussion Thread

xly wrote:

@ 14God

BTW- there really should be a reporter block that reports the name of an object.

May I suggest you to try this : make a global variable having the name of your sprite. Then you can use it as an item of a list or as a parameter of instructions like <Distance To spritename > Then any  block can report this name or a list of names. For example when you find all sprites contained into a circle centered on a given sprite.

Then you would have to type in the name for all your sprites which may be practical for 5 sprites but what about 20 or 100?


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

Offline

 

Board footer