Scratch 1.4 Source Code
As of March 2012, there are two different versions of the Scratch 1.4 source code available. One is made available under the Gnu General Public License V 2.0, and the other is available under the Scratch Source Code License.
|Scratch Source Code
|GNU GPL v2
Which License / Version of the Source Code Should I Use?
If you want to make substantial modifications to the Scratch source code (to add new features that don't exist in the official version of Scratch ), you may want to start with the source code released under the Scratch Source Code License. This source code does not include the Scratch trademarks (the name Scratch, the logo, the Scratch Cat and Gobo), and has the ability to upload to the Scratch website disabled by default.
If you want to package an official version of Scratch, or add it to an open source repository, you should use the source code released under the Gnu General Public License v 2.0. This version includes the Scratch trademarks, and the ability to upload projects to the Scratch website (scratch.mit.edu). Of course, you are welcome to make substantial modifications to this source code as well - but if you do, you must remove the Scratch trademarks and disable the ability to upload projects to the Scratch website. See our trademark policy for more info.
The Scratch trademarks, including the Scratch name, logo, the Scratch Cat and Gobo graphics (the "Marks"), are property of MIT, and the use of the Marks is governed by this policy.
You may use the Marks to refer to Scratch in Substantially Unmodified form.
"Substantially Unmodified" means the source code provided by MIT, possibly with minor modifications including but not limited to: bug fixes (including security), changing the locations of files for better integration with the host operating system, adding documentation, and changes to the dynamic linking of libraries.
A version is not "Substantially Unmodified" if it incorporates features not present in a release of Scratch by MIT. If you do make a substantial modification, to avoid confusion with versions of Scratch produced by MIT you must remove all Marks from your version of the software and refrain from using any of the Marks to refer to your version.
Product vs. Research
Scratch is two things at once: an educational software product and a research project.
The Scratch product is designed to serve the needs of a specific target audience: youth and others who wish to learn and use programming for creative expression. Like any software product, Scratch will evolve over time, with a strong focus on stability and serving the needs of its core audience.
As a research project, Scratch explores ways to use visual programming and user interface design to make programming easier for non-experts. There are dozens of possible directions for future Scratch research, such as modifying the software to run on mobile devices, adding new data types and data structures to the programming language, and applying Scratch scripting ideas to other application domains. Research projects are different from products: they evolve quickly, explore new territory, and may never become as polished, stable, or well-documented as a product. Research projects move faster and farther when they are not held back by product concerns.
Since the Scratch team cannot possibly explore all of the potential research directions suggested by Scratch, we are making the Scratch source code available so that others can also explore and experiment. But please note that our trademark policy includes certain restrictions intended to avoid confusion between the Scratch product and research projects built on the Scratch source code. If members of the Scratch user community stumble on a research project based on the Scratch code, they should be able to tell at a glance that it is not the Scratch product.
Scratch and Squeak
Scratch is written in Squeak, an open-source implementation of the Smalltalk-80 language. The Scratch source code is best explored using the browser and other tools inside the Squeak programming environment.
To get started, first copy the Scratch application ("Scratch.exe" or "Scratch.app") from your normal Scratch folder into the Scratch source code folder. (The Scratch application is actually just a Squeak virtual machine, so any recent Squeak virtual machine should also work.) Also, put copy of the Squeak source code file in that folder if needed (this file is included in the zip file starting with the 1.4 source release). Finally, drop the file "ScratchSourceCode1.4.image" onto the Scratch application. The Squeak programming environment will start up, allowing you to view and modify the Scratch source code.
Scratch is built on a modified Squeak 2.8 image. That version of Squeak is documented in two books: "Squeak: Object-Oriented Design with Multimedia Applications" by Mark Guzdial and "Squeak: Open Personal Computing and Multimedia" edited by Mark Guzdial and Kim Rose. To learn more about Squeak, including how to use the Squeak environment to explore the source code, see www.squeak.org.
Since Scratch simply uses a stock Squeak virtual machine, we are not distributing the Squeak virtual machine source code. Both the source code and pre-compiled binaries for the Squeak virtual machine are available at www.squeakvm.org.
The non-Scratch portion of the Squeak image file is distributed under the Squeak License. Which parts of the image file are Squeak and which are Scratch? The rule is that classes that appear in the original Squeak 2.8 image are covered by the Squeak license while all code in the remaining classes is covered by the license under which the Scratch package was released. The Scratch classes are easy to find in practice: nearly all of them appear in the class categories starting with "Scratch-".
Documentation and Questions
Source code documentation is embedded in the code as class and method comments. In addition, here is a short text file describing the Scratch project file format. Since the Scratch source code is not intended for public consumption, you should not expect the level of comments or API documentation that you get with a system such as Java, where the whole point is to help developers build on its class library. Frankly, if we waited to release the Scratch code until it was all thoroughly and beautifully commented it would never get released.
If you have questions about the source code, try posting to the Advanced Topics forum. The best way to get answers questions about Squeak and Smalltalk-80 is to ask on the "Squeak-dev" mailing list; see the "Squeak Mailing Lists" link at www.squeak.org.