Visual Programming Language

Hmm...I believe I thought Scratch invented the idea because they created the most well-known form of it...Additionally, the Scratch website now says that Scratch 3.0 is a fork of Google's Blockly. Why would the Scratch Foundation/Team need to fork Blockly if they already had a visual programming language in Scratch 2.0?

On another topic, wow. Squeak sounds very interesting! Is there anything else like it? Also, are the messages that are accepted by objects similar to broadcasts in Scratch and Snap!?

Scratch 2.0 was implemented using Flash, a proprietary media manager from Adobe. They did that because at the time the standard HTML/Javascript platform for web sites didn't allow access to the microphone or camera, and they considered those things essential. We all knew that sooner or later HTML5 would support the microphone and camera, but it wasn't expected any time soon, and the Scratch Team couldn't wait for it. (We, on the other hand, were resolved to do things the official right way, and back then Jens hadn't caught the media computation fever, so we used HTML5 Canvas and JS.)

But we all knew that Flash was only a temporary solution. It turned out to be a security hole (not so much for Scratch, which really has nothing much to secure, but for people out in the Real World, such as banks), and it was already determined that browsers would stop supporting it eventually. Adobe even provided a tool to convert your Flash-based pages to Canvas, but it wasn't up to something as complicated as Scratch.

And so they had to write Scratch 3.0 that would use only HTML5/JS. But that's a huge effort -- it took even Jens a long time to implement Snap!. So the Scratch Team decided, correctly, that the whole thing would be a lot easier if they started with Blockly. It was still a big effort, starting with redesigning block shapes in a way that mostly looked like Scratch but fit in with the Blockly representation of widgets. The Blockly team at Google were really happy to have Scratch as a client, because that sealed their importance in block circles, so they helped. (What they should have done is just start with our code, which is more Scratchish than Blockly is! But they didn't. I guess at the time they had to make a decision it wasn't yet clear that Snap! was going to last as a platform.)

It's really the same question as why they had to make Scratch 2.0 when they already had Scratch 1.4, It's because Smalltalk, their implementation language, wasn't being supported forever, and their code was full of bubblegum and baling wire. (Same as BYOB, which was a fork of Scratch.)

This phenomenon is called "software rot." It means that your code is fine, but it requires someone else's code and that dies, or it doesn't die but it has incompatible changes, so you have to start over.

Um, there are a few Squeak-based things, I think, but nothing else quite like it. Smalltalk, its underlying language, is well known, and started the whole trend of object oriented programming.

Messages in Smalltalk are sent to some specific object. BROADCAST in Scratch goes to all objects, and the same was true in Snap! until just recently when we added the arrowhead at the end, and when you click it, the block turns into BROADCAST (message) TO (sprite). That's like a Smalltalk message.

If Smalltalk is no longer supported, why do new versions of Squeak exist?

Also, it's quite ironic, as scratchers are now suggesting that Scratch should be reimplemented in Squeak.

Sorry, I meant to say that Squeak wasn't being maintained. I'm pleased if I'm wrong about that!

Well…Squeak is advertising version 6.0, so I’m not that sure…

If you go here, https://files.squeak.org/ you can see that 6.0 was last modified (or released, idk) in 2022, but 6.1alpha was last modified in 2023, so squeak is still being maintained.

Wow.

Cool! I didn't realize that. Pretty sure Alan Kay isn't working on it now, but I've been wrong before.

So...Scratch 1 was an object oriented visual programming language built in an object oriented visual programming language?

Edit: What is this? I found it in the release notes of 6.0...

Yeah, it's not unusual to build a language in a friendly language. Smalltalk itself is almost entirely written in Smalltalk, Lisp is implemented in Lisp, etc.

What am I supposed to be looking at in that picture?

Squeak is nowadays maintained by our friends at Robert Hirschfeld's Software Architecture Group at HPI (Uni Potsdam). They're awesome and our group at SAP and is in frequent close exchange with them.

Ah, cool. Will they be at Snap!Con?

How can you program a language in itself?

I'm not sure...

The first time you write a compiler for the language, you do it in some other language, or you write a cross-compiler for the same language that runs on a machine other than the one you're compiling for. But after the first time, you can write the compiler in the language itself.

But also, any practical language is largely redundant in its capabilities. In Snap!, for example, you could implement the entire Motion category given just GO TO X:Y:. So even the first time, we could implement the rest of the Motion category in Snap! itself (except that we don't have a compiler, just an interpreter, so running Snap! inside itself would be slow).

So, the second time, you're writing the new compiler within the old compiler of your programming language. Right?

Yes, exactly.

Depending on the language, you might have to write little bits of it in a lower level language. For example, most languages today have automatic memory management, and don't allow their users to allocate or deallocate memory explicitly. So the memory manager for those languages is typically written in a lower level language, probably C.

Well, almost. You're going to need Programming tools SANDBOX script pic (38), Programming tools SANDBOX script pic (37), and Programming tools SANDBOX script pic (36), as well. But, indeed, the vast majority of blocks within the motion category is redundant.

Okay, I'll give you the POSITION reporter. But DIRECTION can be maintained entirely in Snap! code, by making MOVE n STEPS implicitly use a hidden sprite-local DIRECTION variable.

Using hidden reporters is cheating! AND you would still need POINT IN DIRECTION, wouldn't you? (or is there also a hidden way to manipulate the hidden reporter?) :smirk:

Not a reporter (except as a user interface), a variable. I mean, how do you think the Javascript implementation works? HTML Canvas doesn't give us turtle graphics, just "draw a line from here to there."