jstout wrote:
While poking around 'underneath' BYOB in Squeak to add some file handling blocks I found most of the clone code already written
IIRC, that old code just makes a copy of the sprite, which is then independent of the original, so editing a method in the parent isn't reflected in the child. We're aiming for real object inheritance.
'explode': the thing being exploded clones itself 16 times...
'infection': uses 100 or so clones of a 'microbe'...
Monte-Carlo estimate of PI...
Wow! Very StarLogo-esque. I'm glad they worked.
Incidentally, the UK's Computing at School organisation is giving a talk on visual block programming (Scratch, BYOB, StarLogoTNG, and AppInventor at next week's BETT conference in London
What, and they didn't invite me?
Offline
bharvey wrote:
Incidentally, the UK's Computing at School organisation is giving a talk on visual block programming (Scratch, BYOB, StarLogoTNG, and AppInventor at next week's BETT conference in London
What, and they didn't invite me?
I'm going to have about 10 minutes of a 1 hour question and answer session to get the essence of BYOB across. Luckily I get to give the chair the questions. I've come up with the following points I want to make:
1) BYOB is Scratch so that your Scratch knowledge still applies: any projects from Scratch can be imported into BYOB (possible demonstration)
2) BYOB adds the ability to define your own blocks, hence removes the hard ceiling that Scratch has once students (and teachers) get into producing larger programs: by defining your own blocks you are making use of abstraction, and designing a language to fit the problem. This can be done by the teacher to provide a framework for the student, or by the student themselves (demonstration, define a square, rectangle, standard LOGO words in BYOB blocks, …)
3) BYOB can be used in the GCSE O-level in Computing (Ilia Avroutine at High Wycombe is doing this)
4) BYOB makes obvious the Mesh facility for networked programming, by using the existing broadcast and sensor blocks (show networked PONG game)
5) BYOB allows recursion (demonstrate ‘fractal’ tree drawing)
6) BYOB allows functional programming, by treating blocks as items of data, e.g., we can have sprites calling scripts stored in variables (I use BYOB in teaching A-level Computing) (demonstrate save and restore position/heading)
7) BYOB is being used at universities in the States to teach computing to non-computer science majors
The presentation is nominally to teachers at our Key Stages 2-3 (up to 16 years old), and my experience is with 16-18 year olds, so some of these are not strictly relevant
If you've any suggestions I'd be very grateful.
John
Offline
jstout wrote:
I'm going to have about 10 minutes of a 1 hour question and answer session to get the essence of BYOB across.
Wow! That's about a minute for each of your points. I don't think you're going to make it.
If I were doing it, I'd show them my vee project, intended as a first lesson on recursion. (See the project notes.) This demos custom blocks, recursion, and (so naturally that nobody will notice until you point it out) procedures as data. Then I'd hand out a handout with your seven points!
PS: Of course it could be your own favorite little project instead, as long as it uses both recursion and higher order procedures. Also, I don't know anything about the O-level curriculum, but if it includes OOP you might add an eighth point about that capability.
Last edited by bharvey (2011-01-09 03:16:34)
Offline
bharvey wrote:
jstout wrote:
I'm going to have about 10 minutes of a 1 hour question and answer session to get the essence of BYOB across.
Wow! That's about a minute for each of your points. I don't think you're going to make it.
...
PS: Of course it could be your own favorite little project instead, as long as it uses both recursion and higher order procedures. Also, I don't know anything about the O-level curriculum, but if it includes OOP you might add an eighth point about that capability.
No, I'd come to that conclusion. I'm also going to be in the position of showing slides rather than running projects, though I might sneak in an animation.
Thanks for the pointer to the vee project. I always remember the first year we started introducing procedures during one of our first programming lessons, and the way the students independently discovered tail-recursion as a way of doing iteration.
The O-level is being piloted this year (http://www.ocr.org.uk/download/kd/ocr_31053_kd_gcse_2010_spec.pdf) but is only imperative programming as far as I can see from the specification. This will lead on to the 2 years of A-level which then lead to university.
Returning to the cloning code, since the clones are only created when something runs they get the current (latest) copy of the parent's methods which for most applications is all I think you'd need. The only way it wouldn't work is if I created the clones, then edited/added the parent's methods while they were still in existence: still, I could write a despatch method in the parent that reported its current method to the clone for it to execute couldn't I? Wouldn't easily cope with added methods I suppose.
John
Offline
@jsout &bharvey
Quote "The only way it wouldn't work is if I created the clones, then edited/added the parent's methods while they were still in existence:"
When a sprite is duplicated its method (and its local variable ) are also duplicated. This method (say METFUNC ) is supposed to "run" a global function (say GLOBFUNC) having 4 parameters : 1 -name of the sprite 2 - action code (show, hide, explode etc) 3 and 4 values (x,y position or colour for example).
When you add a new capability to Globfunc it is immediately available for each duplicated sprite owning this method. If you add an additional capability only for Red or Blue sprite, you just have to adapt Globfunc in such a way that this new action will be available only for Red/Blue sprites (test on SpriteName input variable). For example you can add a functionality allowing Red/Blue to launch a "broadcast" etc
In practice you can start by writing a simple "prototype" Globfunc having only one action to say "hello world" (Syntax : Metfunc <SpriteName> <Say > <" hello world" <4> ), and later on implement new actions as and when necessary. Every sprite will inherit (or not ) this new capability.
(see http://www.xleroy.net/ByobTuto/thumbnails.html for examples )
Offline
jstout wrote:
While poking around 'underneath' BYOB in Squeak to add some file handling blocks I found most of the clone code already written, so added a Clones category with the following blocks:
[clone me]
[clone me () times]
[delete my clones]
When the clones of a sprite are created they are sent the message CloneCreation, so they can do something different to their 'parent' (all the code was already there).
After working with these a bit I added
[clone me and send ()]
[clone me () times and send ()]
so that you could send different messages to different clone 'families'. These aren't strictly needed since the clone broadcasts are directed towards the clones, not generally, but it's nicer for documentation purposes.
John, is there an easy way to share this code with other people? I'd really like to set my kids up with an underlying clone function, but I'm honestly not much of a programmer myself (most of my kids are far more talented in that direction than I am). Thanks!
Matt
Offline
bharvey wrote:
clintonhackers wrote:
I would love to include some custom blocks in the default setup on the kids' computers.
"You can replace the default cat sprite with a sprite of your own. You default sprite can include multiple costumes, sounds, and even scripts. To set this up, just create your sprite and export it. (To export, right-click on the sprite and choose 'export this sprite.'). Then rename it 'default.sprite' and place it in the Costumes folder."
The above is quoted from the Scratch README file (included in the BYOB distribution); there are other similar customization hints there that might interest you. Your default sprite can include global blocks, so in effect BYOB starts up with a personal block library. You might want to call it default.ysp though; "ysp" is the standard extension for BYOB sprites.
This is really helpful, thanks bharvey. I've been reding through the manual pretty carefully but didn't even look at the README!
last year, the kids stored their projects in the main scratch repository... Any suggestions on how to replicate this functionality for them?
Yeah, we all want this desperately.
The Scratch source license explicitly prohibits uploading of projects made using a modified Scratch to their web site. We don't have the resources to maintain a Scratch-like general upload site, but we're talking about a way for schools to set up their own upload sites as a compromise. (It's less a question of disk space than of dealing with all those flag-if-inappropriate situations.)
As I said in an earlier response just now, the Scratch Team are occasionally hinting at finding a way to allow Scratch-mod-based projects on their site for 2.0. If that happens we'll certainly take advantage of it!
Thanks for this as well. I wonder if you can suggest something in the short term? I have a linux server at my disposal, and have complete control over the services that run on it, but I know next to nothing about windows or the mechanisms that squeak uses to access files. could I for instance set Home=ssh:byob@my.server.net/home/byob/projects/* or something like that? Or can I run a local instance of the scratch website that only my students have access to?
I'm sure there are other, better solutions that you folks can suggest. Again, thanks much!
matt
Offline
jstout wrote:
No, I'd come to that conclusion. I'm also going to be in the position of showing slides rather than running projects, though I might sneak in an animation.
Well, if you make a lot of slides, and run through them very quickly...
since the clones are only created when something runs they get the current (latest) copy of the parent's methods which for most applications is all I think you'd need.
My canonical example is a Breakout game. You make a brick sprite, give it some scripts, make a zillion copies and position them to form a brick wall, and then you discover a bug in the code and have to start over. These bricks are persistent, not temporary.
I suppose you could generate the bricks anew for each game, but then you have the hassle of getting them positioned correctly in the program. With persistent bricks, they never move at all (just hide and show), so you don't have to think about their coordinates.
Offline
xly wrote:
... When you add a new capability to Globfunc it is immediately available for each duplicated sprite owning this method...
Yes, you can simulate OOP behavior -- that has to be true, or they'd never have been able to invent OOP language compilers in the first place! Still, it would be nicer not to have to.
Offline
clintonhackers wrote:
I have a linux server at my disposal, and have complete control over the services that run on it, but I know next to nothing about windows or the mechanisms that squeak uses to access files. could I for instance set Home=ssh:byob@my.server.net/home/byob/projects/* or something like that?
I'm not a Windows sysadmin either, but you can run samba on your Linux box. It's a fileserver implementing SMB, the protocol Windows uses for mounting remote filesystems. Then you can mount the filesystem from your students' logins. Right-click "my computer," choose "mount remote filesystem," pick a mnemonic drive letter, and give it the path
smb:\\my.server.net\home\byob\projects
I think. Check the box "reconnect on login" so that it'll be mounted automatically every session. Anyway, read the samba documentation (start with "man samba") for details.
Offline
bharvey wrote:
xly wrote:
... When you add a new capability to Globfunc it is immediately available for each duplicated sprite owning this method...
Yes, you can simulate OOP behavior -- that has to be true, or they'd never have been able to invent OOP language compilers in the first place! Still, it would be nicer not to have to.
Your CV is impressive and I easily imagine that for the future developments -to still "raise the ceiling" of BYOB - you aim something more clever, more impressive, more poweful, more academic than just adding some new "cosmetic" instructions.
Offline
xly wrote:
Your CV is impressive and I easily imagine that for the future developments -to still "raise the ceiling" of BYOB - you aim something more clever, more impressive, more poweful, more academic than just adding some new "cosmetic" instructions.
That's the nicest criticism I've ever gotten!
OOP is "cosmetic" only in the sense in which everything beyond machine language is cosmetic. I think you're overreacting to the people who say OOP is the only acceptable way to write a program. It's a valuable paradigm that does a great job of modeling the interactions of independent agents. And I think kids will benefit from learning to think of "clone" as meaning "inherit" rather than the simpler "copy."
But just for you, in BYOB 5.0 we'll add unification.
Offline
clintonhackers wrote:
John, is there an easy way to share this code with other people? I'd really like to set my kids up with an underlying clone function, but I'm honestly not much of a programmer myself (most of my kids are far more talented in that direction than I am). Thanks!
Matt
Let me have your email and I'll send you the updated BYOB.image Ilia Avroutine and I are using (Brian, Jens: is this OK? I have a change set but not tested filing it in to a straight 3.08 image yet). It's based on 3.08 so it's up to date (about 4MB zipped). I haven't done much (well, any at all really) documentation but I'll knock something off quickly and include a few clone projects for you. The Files blocks were really so that Ilia could use BYOB in his GCSE teaching here in the UK.
John
Offline
jstout wrote:
Brian, Jens: is this OK?
Yes, of course!
I suppose to avoid confusion you should add something to the About box saying it's a mod.
EDIT: Good grief, my 1000th post. I should get a life.
Last edited by bharvey (2011-01-09 14:33:07)
Offline
bharvey wrote:
jstout wrote:
Brian, Jens: is this OK?
Yes, of course!
I suppose to avoid confusion you should add something to the About box saying it's a mod.
EDIT: Good grief, my 1000th post. I should get a life.
Congrats! But didn't someone tell you? This IS your life.
Offline
jstout wrote:
Let me have your email and I'll send you the updated BYOB.image Ilia Avroutine and I are using (Brian, Jens: is this OK? I have a change set but not tested filing it in to a straight 3.08 image yet). It's based on 3.08 so it's up to date (about 4MB zipped). I haven't done much (well, any at all really) documentation but I'll knock something off quickly and include a few clone projects for you. The Files blocks were really so that Ilia could use BYOB in his GCSE teaching here in the UK.
John
Could you please put it up somewhere? That would be awesome.
Offline
IT'S NXIII!
I'm sorry, I forgot about Palringo... I'll try to be on tomorrow.
EDIT: Capitalizing nXIII for emphasis doesn't have quite as much of an effect on it as I'd like.
Last edited by shadow_7283 (2011-01-09 21:43:33)
Offline
@ bharvey
will you be able to create your own block category in byob (x+3.0.8)?
some custom blocks don't fit the regular categories (like blocks designed make using meshes easier)
Offline
14God wrote:
@ bharvey
will you be able to create your own block category in byob (x+3.0.8)?
Well, we do already have the "other" (grey) category.
Making whole new palettes is somewhere on the list, but I don't think it's quite crucial enough to make it into 3.1, given our tight schedule. Maybe eventually.
P.S. Yeah, it's not that hard, as features go, but there are a bazillion little not-that-hard features, and we're still busy designing sprite inheritance.
P.P.S. @shadow: How about "Nxiii"?
Offline
shadow_7283 wrote:
IT'S NXIII!
I'm sorry, I forgot about Palringo... I'll try to be on tomorrow.
EDIT: Capitalizing nXIII for emphasis doesn't have quite as much of an effect on it as I'd like.
I was gonna say invert the caps, but that doesn't work either... Nxiii. I think sticking to BBCode should help.[/offtopic]
Anyway, great work on morphic.js, Jens! Is the approach to porting BYOB to it just converting Squeak to JS and keeping all the classes, etc. (with exceptions for the plugins, etc.)
edit: Didn't see bharvey's suggestion. Oh well.
Last edited by nXIII (2011-01-10 14:56:51)
Offline
nXIII wrote:
Is the approach to porting BYOB to it just converting Squeak to JS and keeping all the classes, etc. (with exceptions for the plugins, etc.)
IANJ, but no, one goal is to speed up reporters (thus the sort of
recursive functional programs I like to write ) by separating evaluation from display internally. My theory (Jens might not agree) is that we find a nice robust Scheme interpreter in JS and modify it into a BYOB interpreter -- which shouldn't be that much of a modification, really.
Offline
bharvey wrote:
I'm not a Windows sysadmin either, but you can run samba on your Linux box. It's a fileserver implementing SMB, the protocol Windows uses for mounting remote filesystems. Then you can mount the filesystem from your students' logins. Right-click "my computer," choose "mount remote filesystem," pick a mnemonic drive letter, and give it the path
smb:\\my.server.net\home\byob\projects
I think. Check the box "reconnect on login" so that it'll be mounted automatically every session. Anyway, read the samba documentation (start with "man samba") for details.
hmmm. I'll give it a try. Not sure how I feel about having a windows share open to the internet... But I'll at least see if it works at all, and then think about security. Thanks for this.
Offline
jstout wrote:
Let me have your email and I'll send you the updated BYOB.image Ilia Avroutine and I are using (Brian, Jens: is this OK? I have a change set but not tested filing it in to a straight 3.08 image yet). It's based on 3.08 so it's up to date (about 4MB zipped). I haven't done much (well, any at all really) documentation but I'll knock something off quickly and include a few clone projects for you. The Files blocks were really so that Ilia could use BYOB in his GCSE teaching here in the UK.
John
hmm, interestingly there seems to be no way to send you my email privately! it's matt.price@utoronto.ca. And I'd be happy to put it on the web, as someone else asked I think. If it's only a couple of MB I can just add it as a blog attachment if it helps. Thanks John!
Matt
Offline