LiquidMetal wrote:
In scratch, the blank red area that serves as a backround behind the items in a list extends to the right of the list (graphically). In BYOB, it ends right after the data in the item of the list.
Hmm, interesting. What you said isn't quite true; if you put in a BYOB list the same kinds of data (numbers and text) that can go in a Scratch list, then the result looks like a Scratch list. But if you put a block or a script in the list, its red background is just wide enough for it and a slight margin.
Sounds like a bug, but the list display stuff all has to be redesigned anyway, so it'll probably be consistent in 4.0.
Offline
LiquidMetal wrote:
If you make variables work the way panther has them, it would increase first classiness.
Agreed, first class variables would be a great addition. Scheme (in most ways a champion among languages for making everything first class) doesn't have first class variables mostly for efficiency reasons; you can compile a program much more efficiently if the compiler knows in advance exactly what variable will be used when the program runs. That clearly isn't the case if, e.g., you can have a variable whose value is the name of the variable you really want. But I think we'll get there pretty soon in Snap.
Even more so; what if all blocks were potentially everything? For example, the clone block, it is a stack block, but if you put it in a place where a (blocklikethis) goes, it can switch for that instance of the block. Some blocks might not work like this, those you just couldn't put in those spaces, but it would be good for some blocks.
In certain circumstances this makes sense, and we try to handle those cases. But there's nothing in the idea of first class data types that says we have to try to shoehorn some value into a role it can't fill; for example, you can't take the square root of a text string!
And when do you think 4.0 will come out?
We've been talking about this. Ideally, /some/ usable (but alpha) version will be out in time for Berkeley's fall semester (mid-August). But I don't think that first version will be close to ready for release; it'll have a zillion missing features, all the things we spent a year adding to 3.0 and now have to reimplement. About a month into the semester is when they start using recursion, so they can, if necessary, start the semester with 3.1 and then switch later to 4.0 in some hopefully stable form.
So, what this means is that we hope to have something posted here in the forum for y'all to poke at in August, but it may be January before we have something we'd want to release officially.
OTOH, Jens is famous for delivering code in a fifth the time he thinks it's going to take, so you never know.
Offline
First class variables are and interesting suggestion - you're really understanding first-class-ness now! -
As Brian pointed out, not even Scheme has them, neither does Smalltalk, for good reasons. What BYOB 3 does have, instead, are lexically scoped temporary variables (called script variables), which should take care of most issues in which you need to dynamically introduce a variable.
Offline
Jens wrote:
What BYOB 3 does have, instead, are lexically scoped temporary variables (called script variables), which should take care of most issues in which you need to dynamically introduce a variable.
Yeah, but that doesn't let you do indirect addressing: a variable whose value is the variable you want to get/set.
EDIT: And BYOB3 actually has more than that, something closer to Pantheresque variables: If (e.g. because a script is copied to another sprite) a variable reference loses sight of the variable to which it refers, we look around for a variable of the same name in the current scope. So the mechanism to look up variable names at runtime is already in place.
Last edited by bharvey (2011-07-21 11:29:18)
Offline
bharvey wrote:
Yeah, but that doesn't let you do indirect addressing: a variable whose value is the variable you want to get/set.
Wow, that is exactly what I was thinking! In panther, I once used that to set variables a-z to something, and it was much more efficient.
Will 4.0 have the dropdowns in the block maker?
Could you explain the edit elements thing?
In scratch, you can't put stuff into the list place (item (any) of [list]) . Does adding that functionality require extra code to the block, or just allowing it?
Offline
The list dropdown needs one word changed to allow block drops. I forgot which, but it was under uncoloredargmorph...
Offline
Hardmath123 wrote:
The list dropdown needs one word changed to allow block drops. I forgot which, but it was under uncoloredargmorph...
ChoiceArgMorph to ChoiceOrExpressionArgMorph.
Offline
Ah.
Last edited by Hardmath123 (2011-07-21 12:13:49)
Offline
LiquidMetal wrote:
Wow, that is exactly what I was thinking! In panther, I once used that to set variables a-z to something, and it was much more efficient.
Yeah, that's the sort of application I had in mind. Were you making a letter frequency distribution histogram? I did that in a Logo program, long ago, to help the user solve cryptograms.
Will 4.0 have the dropdowns in the block maker?
Yes. Jens has started on that already. I think we still need some discussion about what can be put in a dropdown (e.g., some of the Scratch ones have fixed options, but others have all the available variable names, etc.) and about whether we can generalize the ability to change the rest of the prototype based on a dropdown choice, the way RUN, CALL, and LAUNCH do.
Could you explain the edit elements thing?
It's a Scratch-notation-like representation of the Smalltalk code that implements each primitive block. Jens wants you to be able to write arbitrary Smalltalk programs using drag and drop. (I guess it'll be arbitrary Javascript programs in 4.0. ) If you want more than that, I'll leave this question for Jens, except to say that there's a documentation file in the BYOB distribution.
In scratch, you can't put stuff into the list place (item (any) of [list]) . Does adding that functionality require extra code to the block, or just allowing it?
As others have said, it doesn't take that much in the block itself. But, you guys, Jens had to invent the ChoiceOrExpressionArgMorph class! There's nothing like that in Scratch.
A lot of these details should be much easier to do in 4.0 because they'll be designed in from the beginning rather than pasted on top of an existing language without those features. There's a lot in BYOB3 that just barely works. My favorite example is that as you're dragging a reporter onto a Reporter-type slot, you should see the grey border first, and have to keep getting closer to see the white halo. We were agreed about that back in 3.0, but Jens said it was too hard for reasons I never knew -- adding this on top of the Scratch white-halo code was much easier if you see the white halo first.
Offline
bharvey wrote:
Jens wrote:
I wrote a lot of new classes, but ChoiceOrExpressionArgMorph wasn't among them.
Oh! Sorry... Where is there one of those in Scratch?
"switch to costume <costume>" for example, uses a ChoiceOrExpressionArgMorph to represent the costumes' names.
"play sound <sound>" does the same thing with the sounds.
Offline
Baderous wrote:
"switch to costume <costume>" for example, uses a ChoiceOrExpressionArgMorph to represent the costumes' names.
"play sound <sound>" does the same thing with the sounds.
Oh yeah! I forgot about that. Mea culpa.
Offline
Brian/Jens, Know of any good resources on reinforcement learning? I plan to specialize in AI. I hope to someday make an learning(!) AI engine for games so that you don't get bored of the familiar feeling when playing against bots.
Offline
14God wrote:
Summer will soon be over, can't wait for Snap. Whats the current ETA?
We'll release something in late August, I'm pretty sure, but it's likely not to be complete, more a proof of concept. It'll probably take another month for the full official 4.0 to be finished. But this is what I've been saying all along... You'll be the first to know if anything changes.
Offline
bharvey wrote:
(I guess it'll be arbitrary Javascript programs in 4.0. )
That's really nice to hear: Javascript is MUCH easier to learn than smalltalk in my opinion; it's structured like most other programming language families like C, C++, and C#, Java, and BASIC.
Offline
You know, I was working on
And I suddenly understood 3.0: Recursion and lambada!
(You might remember I was having a hard time with those. )
Offline
scimonster wrote:
You know, I was working on
http://goo.gl/RrVw8
And I suddenly understood 3.0: Recursion and lambada!
Yay!
Now, how are you on higher order functions? And sprite inheritance?
Offline
Sidharth wrote:
Javascript is MUCH easier to learn than smalltalk in my opinion; it's structured like most other programming language families like C, C++, and C#, Java, and BASIC.
If you're like me, it's not really the language structure that gets in the way; it's the fact that there's no plain text file of the whole program, and instead you have to find your way around in the browser. All those other languages (except C and BASIC, which make no pretense of being object oriented) (and I guess except Javascript, which uses prototyping OOP like BYOB instead of class/instance OOP like the others) are just half-hearted approximations to Smalltalk, which really takes OOP seriously.
Offline
bharvey wrote:
scimonster wrote:
You know, I was working on
http://goo.gl/RrVw8
And I suddenly understood 3.0: Recursion and lambada!Yay!
Now, how are you on higher order functions? And sprite inheritance?
Well, I'm going to have to read the manual. ;P
Offline
Once again I must say Python and Javascript FTW!
Offline
bharvey wrote:
Sidharth wrote:
Javascript is MUCH easier to learn than smalltalk in my opinion; it's structured like most other programming language families like C, C++, and C#, Java, and BASIC.
If you're like me, it's not really the language structure that gets in the way; it's the fact that there's no plain text file of the whole program, and instead you have to find your way around in the browser. All those other languages (except C and BASIC, which make no pretense of being object oriented) (and I guess except Javascript, which uses prototyping OOP like BYOB instead of class/instance OOP like the others) are just half-hearted approximations to Smalltalk, which really takes OOP seriously.
Then I guess I'm not like you I am still trying to learn Smalltalk and understand what all those words mean BUT, I also don't like the browser, but can you imagine fitting all of Scratch into ONE text file?
What I meant was that making certain things in all those programming languages is similar:
Function MyFunction(Arguments) { } (or something else to indicate end of function)
And in Smalltalk, the syntax is completely different. In my opinion, Smalltalk is not the perfect language for a beginner because it is not like most "mainstream" programming languages (Again, that's my opinion). I started out with BASIC (Just BASIC) and Javascript, so I learned the difference between Object-Oriented programming languages and non-Object-Oriented programming languages.
Not ripping on Smalltalk or anything, but Javascript will make coding blocks MUCH easier (for me).
Offline