bharvey wrote:
I don't have a good sense of the timing of Scratch 2.0, nor of the time it'll take us to develop BYOB 4.0. (It'll be in a language I understand, so I can help this time. ) So I don't know whether or not it'll turn out that we base our code partly on theirs or vice versa or neither.
Oh... I better brush up on my JS too! 'Course you won't need a teenager to help you with code, but it'd be nice when/if I help with testing! I keep meaning to learn it, but as I said before, I'm experiencing a lack of free-time lately.
Oh, to take over the world, of course! In the best possible scenario, the Scratch Team see the light and put lambda in Scratch 2.0, or maybe 2.1, and I can get out of the software business altogether.
0_0 You're brilliant at software design (from what I've seen so far)! Don't stop after BYOB! I fully expect you to take my on as an intern when you start your next software project!
Then every high school kid in (at least) the US learns BYOB!
That'd be SO COOL! I hope it's available before I leave high-school!
But even if we never touched BYOB again (not going to happen, don't panic, shadow!)...
Thanks for the side-note.
(Not fishing for compliments, y'all don't have to say "I agree"! Just, my hopes for BYOB are mostly already met.)
But you deserve compliments anyway.
BYOB is great!
Offline
I was back on the first page of the discussion, just looking around, when I saw this:
bharvey wrote:
Sure. Jens can speak for himself on this, but I don't want BYOB, as a thing-in-itself, to take over the world. I want /BYOB's ideas/ to take over the world, by being incorporated into Scratch itself.
Great job being consistent for 85 pages!
Offline
What are your plans/hopes for BYOB/Scratch?
Let me chime in here... I'm still very much hoping that the Scratch Team will incorporate BYOB's core ideas of custom blocks, recursion, lambda and first-class lists into Scratch 2.0, and then we'll all be happy but I don't have any confirmation about this. There are many, many features for BYOB on our list that I'd love to implement, but I'm currently very much involved in my professional work, and have very little time for hacks. But I do agree with Brian that we'll want to develop a 3.1 version with first-class sprites and some other tricks. I'd also love to integrate sprite composition better with the language, and - of course - I want prototypes and inheritance for sprites.
In the meantime I'm checking out various alternatives for what Brian calls BYOB 4.0, mostly JavaScript / Canvas and the Lively Kernel. I've started to write a Morphic framework for JavaScript and Canvas that I'm confident will someday let us create a multithreaded blocks-based language in a web browser. But we might just opt for the Lively Kernel or even something totally different (e.g. Scheme), we'll see...
bharvey wrote:
The current plan is to write it in Javascript, because everyone seems to want things to run in the browser (for reasons that escape me, but I'm a curmudgeon)
Why in a browser? Gee, I dunno, 'cos everybody sayz it's the cool thing to do.
Anyway, I'd love to get the JS-Morphic framework developed to a stage where it's reasonably complete within the next weeks (or possibly months) and then go back to enhance our Squeak version for 3.1. You can be sure that we will be using (and supporting) the Squeak version for a long time before anything else (BYOB 4.0) will be ready (at the moment it's just a bunch of ideas and experiments).
Offline
fullmoon wrote:
I've been thinking about how to represent Java/Flash-style, dot-operator OOP with blocks...
You want macros! That is, you want something that can turn
dot operator stuff into calls to dispatch procedures, BYOB-OOP style. A macro is a block or script that, when called, returns a block or script (respectively) that replaces the original call in its context to be re-evaluated.
Simple example: Here's a macro LOCALSET <varname> <value>:
THE SCRIPT
SCRIPT VARIABLES <varname>
SET <varname> TO <value>
This is trivial in Lisp-like languages, not so trivial in graphic
Scratch-like languages because for example "varname" is the name of a variable inside LOCALSET, but that isn't what you want in the reported script; you want the name that's the value of varname!
I'm not sure, but I think a sufficiently general solution to this problem is pseudoquoting. So, we invent an EVAL-ME-NOW! block that looks like THE BLOCK and is only usable inside a THE BLOCK/SCRIPT, and its value is what's used in the result, so for the example above you'd say
THE SCRIPT
SCRIPT VARIABLES [EVAL-ME-NOW! <varname>]
SET [EVAL-ME-NOW! <varname>] TO [EVAL-ME-NOW! <value>]
but I'm making this up as I go along and it might be nonsense.
Offline
bharvey wrote:
fullmoon wrote:
I've been thinking about how to represent Java/Flash-style, dot-operator OOP with blocks...
You want macros! That is, you want something that can turn
dot operator stuff into calls to dispatch procedures, BYOB-OOP style. A macro is a block or script that, when called, returns a block or script (respectively) that replaces the original call in its context to be re-evaluated.
Naw, I'm sure I want actual dot-operator style OOP. Interesting story, though: I tried writing a macro evaluator for Haiku (that scripting language I'm working on) to replace access operator calls at parse time with BYOB-style global CALL commands. That is:
net Socket("localhost",42001) writeUTFBytes(theBroadcast)
becomes:
$call($call($call($native("net::","Socket"),["localhost",42001]),"writeUTFBytes"),$value_in_context("theBroadcast","selfObject"))
This was originally because I thought it would be easier. As it turns out, I found a much more elegant solution, but it was an interesting foray into the world of BYOB's OOP, which undoubtedly has a formal name that I can't recall at the moment...
Offline
shadow_7283 wrote:
'Course you won't need a teenager to help you with code
I don't think we want to turn this into a Panther-style collaboration, but if there are bits of separable work we can farm out, I wouldn't rule it out. (We definitely want to rope in a teenager whose name starts with 'n' and ends with 'I'. ) But Jens and I have to put together an overall design before we could do that. He's already working on the GUI end, and when this semester is over I'm going to start thinking about the core evaluator. But it's still mostly just talk -- don't hold your breath.
You're brilliant at software design (from what I've seen so far)! Don't stop after BYOB! I fully expect you to take my on as an intern when you start your next software project!
I'll -- hesitantly -- take credit for some aspects of the graphical display of first class procedures. (The display of lists of lists was obvious; nobody particularly gets credit for that bit of design, although Jens had to do a huge amount of work to implement it.) But, as I've said before, I don't get any credit for the idea of first class procedures! That's Alonzo Church, John McCarthy, Gerry Sussman, and Guy Steele. I was just in the right place at the right time to be influenced by them.
But I don't wanna design software! I'm an old man. (61 is ancient by software-design standards.) What I wanna do is sit by the fire playing with my grandchildren, but I don't have any, so instead I borrow other people's grandchildren by volunteering at the local elementary school.
Thanks for the compliments at the end.
Offline
fullmoon wrote:
Naw, I'm sure I want actual dot-operator style OOP.
My point is, if we had macros, the user of your language could write dot-operator OOP and it would get syntactically translated into BYOB oop. So, the user would say
object.message(arg1,arg2)
and you'd macro-translate that to
call (call <object> with inputs <message>) with inputs <arg1> <arg2>
... except that I'm not sure what a Scratch-GUI-like notation would be for the "object.message" part.
Offline
bharvey wrote:
What I wanna do is sit by the fire playing with my grandchildren, but I don't have any, so instead I borrow other people's grandchildren by volunteering at the local elementary school.
Haha xD
Offline
@bharvey
Yep, I understand what the macro does, but it's not what I'm looking for. If I built a Scratch mod from the ground up, I'd just create an object primitive. This would eliminate the need for using CALL as an access operator, since scripts could then also be properties of an object returned by a function rather than just results of a lambda like in BYOB. This isn't necessarily as pure as BYOB, but it's just how I would do it. So...you wouldn't loose any lambda capabilities, but I think you'd gain in terms of convenience.
bharvey wrote:
... except that I'm not sure what a Scratch-GUI-like notation would be for the "object.message" part.
That's the the interesting part. If I ever get time I'll create some mockups.
Offline
fullmoon wrote:
So...you wouldn't loose any lambda capabilities, but I think you'd gain in terms of convenience.
I'll be really interested to see it. I'm afraid you might be following in the footsteps of Java, where, yeah, you can get something technically equivalent to lambda with anonymous classes, but it's pretty hideous. The thing I want to see you do is
Offline
bharvey wrote:
fullmoon wrote:
So...you wouldn't loose any lambda capabilities, but I think you'd gain in terms of convenience.
I'll be really interested to see it. I'm afraid you might be following in the footsteps of Java, where, yeah, you can get something technically equivalent to lambda with anonymous classes, but it's pretty hideous. The thing I want to see you do is
http://cs.berkeley.edu/~bh/compose.bmp
Anonymous classes are the stupidest thing I have ever encountered. Ever.
In this hypothetical world I'm imagining, where I have the time and the programming skill to create something resembling BYOB, the first thing I would do would is make scripts and blocks first-class. If I, hypothetically, did create something resembling BYOB, the only noticeable change would be that instead of:
call(the script{}) with args[] say(length of (my list))
You'd have:
[the script {}] -> call(args[]) say(my list -> length)
I think that if this imaginary, hypothetical Scratch 2.0 mod were expanded to include first-class sprites, scripts, sounds, sockets, whatever, I would prefer style the syntax this way. But there'd be nothing stopping someone from creating classes BYOB style with lambdas.
Offline
fullmoon wrote:
Anonymous classes are the stupidest thing I have ever encountered. Ever.
I guess you don't live in California and/or weren't following the election.
Okay, sorry for doubting you; I should have known better!
Code:
[the script {}] -> call(args[]) say(my list -> length)
Hmm, are you going to go all the way like Smalltalk and have numbers be objects?
3.+ 5
Smalltalk doesn't really look like that, but only because they elide the . or -> operator and put the message right after the object. (I know you know; I'm avoiding someone else telling me so. )
P.S. Actually, the stupid thing isn't anonymous classes, exactly; it's that Sun released four iterations of the Java design before they hired Guy Steele. That's why he had to sneak/retrofit lambda into the language instead of having it proudly front and center.
P.P.S. I know, no politics -- but in this election, no matter what your political views, there was something on the ballot for you to consider stupid.
Last edited by bharvey (2010-11-04 00:35:25)
Offline
bharvey wrote:
Jens wrote:
what Brian calls BYOB 4.0
Oh yeah, I'm supposed to call it Snap. I forgot!
What do you think of SCOB (for SCratch +OB for own block). I'm kidding ?
Brian can you tell me where to find the internal script of C-shape block.
Thanks.
Offline
fullmoon wrote:
Naw, I'm sure I want actual dot-operator style OOP.
Interesting discussion!
Why wouldn't the "dot" just be an empty argument slot into which you could drop the object (or the expression that returns the object) that receives the block's expression? That's how I did it for Elements. The problem with this approach is that it doesn't avoid errors where the receiver doesn't understand the message (or, in ECMA-script-ese - where the object's property is undefined).
I guess the "Scratch" way to resolve such issues is to not allow direct inter-object messaging at all, just "sensing" in the OF block. Another way to avoid such errors would be drop-down menus with all possible messages/properties. But that would quickly clutter up everything to a point where it becomes hard to handle.
Last edited by Jens (2010-11-04 04:55:23)
Offline
xly wrote:
Brian can you tell me where to find the internal script of C-shape block.
You make a C-shaped slot by making an input slot in the usual way, with the orange plus sign, and selecting "C-shaped" as the type in the long input name dialog. This puts an orange blob in the prototype, just for other types of input -- it doesn't make the prototype itself C-shaped. But the orange blob looks like "foo [" instead of just "foo"; the open square bracket is sort of C-shaped, to remind you that it's that kind of input.
Then you just drag the orange blob from the prototype into (probably) a RUN block's input slot to use it.
Right now there's no way to turn the script into a readable list structure, if that's what you're asking. It's on our list.
Offline
Jens wrote:
Why wouldn't the "dot" just be an empty argument slot into which you could drop the object (or the expression that returns the object) that receives the block's expression?
There's no "dot" block, or anything...instead, blocks can be taken from the palette and tacked to the end of object reporters. This block here is neither a command nor a reporter...it fits in wherever you want to put it. These triangle-tipped block fragments form a statement, and at any time you can click the end of the statement to get a searchable list of properties of that object (maybe a floating blocks palette?).
This sounds ridiculous, but more mockups to come.
Offline
fullmoon wrote:
Jens wrote:
Why wouldn't the "dot" just be an empty argument slot into which you could drop the object (or the expression that returns the object) that receives the block's expression?
http://i302.photobucket.com/albums/nn10 … bj-msg.png
There's no "dot" block, or anything...instead, blocks can be taken from the palette and tacked to the end of object reporters. This block here is neither a command nor a reporter...it fits in wherever you want to put it. These triangle-tipped block fragments form a statement, and at any time you can click the end of the statement to get a searchable list of properties of that object (maybe a floating blocks palette?).
This sounds ridiculous, but more mockups to come.
Wait, from a Morphic point of view, who's the child here?
Offline
nXIII wrote:
Wait, from a Morphic point of view, who's the child here?
I haven't the foggiest idea. This is all assuming that Scratch 2.0 is released as Flash or JS, so I'd be able to do some decent tinkering with it.
Offline
nXIII wrote:
fullmoon wrote:
Jens wrote:
Why wouldn't the "dot" just be an empty argument slot into which you could drop the object (or the expression that returns the object) that receives the block's expression?
http://i302.photobucket.com/albums/nn10 … bj-msg.png
There's no "dot" block, or anything...instead, blocks can be taken from the palette and tacked to the end of object reporters. This block here is neither a command nor a reporter...it fits in wherever you want to put it. These triangle-tipped block fragments form a statement, and at any time you can click the end of the statement to get a searchable list of properties of that object (maybe a floating blocks palette?).
This sounds ridiculous, but more mockups to come.Wait, from a Morphic point of view, who's the child here?
Why not try to use or modify the "magic" instruction <property OF sprite> to chain <properties of properties of properties. The last property is a method which draws one SQUARE, the before-last method calculates the STEP, coming from another method (ie age of captain ) etc ?
Offline
(...of former message)
Create a variable-method distx to report x^2 (with THE BLOCK)
Same for disty
Create dist which calls the 2 methods <distx OF sprite1> and <disty OF sprite1> and takes the sqrt of their sum
Call dist with parameters xposition and yposition and you get the distance from the origin. It proves probably nothing more than you can pass "methods" to "methods"
Offline
fullmoon wrote:
nXIII wrote:
Wait, from a Morphic point of view, who's the child here?
I haven't the foggiest idea. This is all assuming that Scratch 2.0 is released as Flash or JS, so I'd be able to do some decent tinkering with it.
As we speak, Jens is implementing Morphic in JS, so it's not clear that Scratch 2.0 will be Morphic-free.
Offline
fullmoon wrote:
Jens wrote:
Why wouldn't the "dot" just be an empty argument slot into which you could drop the object (or the expression that returns the object) that receives the block's expression?
http://i302.photobucket.com/albums/nn10 … bj-msg.png
There's no "dot" block, or anything...instead, blocks can be taken from the palette and tacked to the end of object reporters. This block here is neither a command nor a reporter...it fits in wherever you want to put it. These triangle-tipped block fragments form a statement, and at any time you can click the end of the statement to get a searchable list of properties of that object (maybe a floating blocks palette?).
This sounds ridiculous, but more mockups to come.
I like this idea. Am I the only one?
Offline
ScratchReallyROCKS wrote:
I like this idea. Am I the only one?
No, I like it too. It's sort of like Elements, a GUI for OOP. I'm not an OOP programmer by instinct, like fullmoon, though; it's functional programming that really turns me on.
P.S. Hey, fullmoon, want to do the BYOB3 OOP tutorial? I don't seem to be getting around to it. What we need is an example with class variables, instance variables, methods with and without extra inputs, and delegation. I mean, working up to that starting with a simple instance-variable example like counter.
Last edited by bharvey (2010-11-04 23:04:01)
Offline
bharvey wrote:
P.S. Hey, fullmoon, want to do the BYOB3 OOP tutorial? I don't seem to be getting around to it. What we need is an example with class variables, instance variables, methods with and without extra inputs, and delegation. I mean, working up to that starting with a simple instance-variable example like counter.
I'd be honored. I'll have to think about the best way to approach writing it, though, because as you said, BYOB is not my native OOP style. The thing I stumbled on while figuring out BYOB OOP (I just know it has a formal name...) was the idea that the variables defined by "script variables" are persistent when working with classes. I get that all the references to these variables in the class's lambdas are very tightly bound, but it's difficult to explain to someone else.
Offline