Would it be possible to get access to the source of the ScratchApplet? I am considering doing a Flash/AS3 port of the player and although I am fine working from the Smalltalk/Squeak source, I thought the Applet might represent things in a slightly more AS3 compatible way. Or at least it would have a different perspective that might also be useful :-)
I am not sure what I can commit to on an ongoing basis, but given I am comfortable in Java, Smalltalk, and AS3/Flex, I may be able to help with porting 'player' features (say for 1.4) from Squeak to Java and AS3 -- and potentially with runtime performance optimization and 'into native language' translation.
Offline
Look's like it's only available compiled. I'd be interested in exactly how the Java port works, too.
Offline
parseroo wrote:
Would it be possible to get access to the source of the ScratchApplet? I am considering doing a Flash/AS3 port of the player and although I am fine working from the Smalltalk/Squeak source, I thought the Applet might represent things in a slightly more AS3 compatible way. Or at least it would have a different perspective that might also be useful :-)
I am not sure what I can commit to on an ongoing basis, but given I am comfortable in Java, Smalltalk, and AS3/Flex, I may be able to help with porting 'player' features (say for 1.4) from Squeak to Java and AS3 -- and potentially with runtime performance optimization and 'into native language' translation.
that would be AWESOME then I could play them on my psp!! or anyone else who has one.
join me for some Black Ops on xbox: termhn or for some rock band on PS3: rocket232Offline
I asked this same topic a while ago but I didn't get any answer. I would be very interested in getting the source code of the applet as I'm thinking to a complete rewrite of Scratch with Java (crazy project? I guess so but... dreaming is free
). Team? What do you say? Will the source code for the applet be released in the future?
Offline
I don't have the source but have enough information from the JAR components to compare them to the Smalltalk version. This is a quick summary:
The Java Applet is purely a Scratch runner, and although it reads the same source file as the Squeak / Editor version, it discards the details it doesn't need to run the Scratch program. On writing out the source file, Squeak turns the blocks that make up a program into a 'Tuple' -- it throws away the graphic programming object (the Morph) and replaces it with Symbols (Strings) that can be used to look up the programming object when read back in. The Java Scratch runner reads these symbols to execute Scratch.
Now the strange part: the Java player does not ever recreate the Scratch programming objects within Java proper. There is no 'IfElseBlockMorph' or any equivalent within Java. Instead, the Java player has an internal Logo machine (I believe a modified LogoChip) and Scratch is executed on top of this Logo interpreter. You can see the Scratch->Logo runtime translation inside the JAR with the file names '.logo'.
Maybe with the full source (or some developer comments) this would make more sense to me -- but I am guessing maybe there was an early version of Scratch done on Logo? Maybe a goal was to have the LogoChip be able to run Scratch? And somehow the Java version has maintained that history. Either that or someone on the Scratch team really likes Logo :-)
In any case, I decided to work directly from the Squeak source because (1) I had the source :-) (2) I believed it would be more maintainable to just have two languages involved [vs. adding Logo or something], and (3) That means the designs can mirror each other as much as possible and maintenance/enhancement would again be easier.
So if you are really interested in converting the whole of Scratch from Squeak to Java [not my recommendation], I would suggest just diving into the 'Scratch' categories within Squeak. Starting at: 'ScriptableScratchMorph' and 'ScratchProcess' and the hierarchy under 'BlockMorph' has most of the language within it. 'ObjStream' and Smalltalk itself has the serialization capabilities. And then there are all the graphics (both runtime and editor) which would need to be done. The Java source might be useful for some of the runtime stuff (e.g. moving of Sprites, playing sounds, etc.), but none of the Scratch editing UI or even its model (the blocks) are currently in the Java source.
Offline