Skip to content

Scratch

Logo's idea of programming for children, rebuilt as snap-together blocks

MIT Media Lab's Lifelong Kindergarten group launched Scratch in May 2007: a language whose commands are coloured blocks shaped so that they only fit together in ways that make sense. Its designers set out to finish what Logo and BASIC had started in the schools of the 1980s, and by 2024 its website counted more than 135 million registered users.

Scratch is a programming language in which nobody types a command. A program is a stack of coloured blocks, dragged from a palette and snapped together, and the blocks are shaped so that they only fit in ways that make sense. The Lifelong Kindergarten group at the MIT Media Lab released it in May 2007. Its designers saw it as unfinished business from the home-computer era. “When personal computers were first introduced in the late 1970s and 1980s,” they wrote in 2009, “there was initial enthusiasm for teaching all children how to program. Thousands of schools taught millions of students to write simple programs in Logo or Basic.” Most schools soon moved on, and Scratch was their attempt to work out why, and to do better.

Fast facts

  • Developed by: Mitchel Resnick’s Lifelong Kindergarten research group at the MIT Media Lab.
  • Work began: around 2003. Public launch: May 2007, with its website at scratch.mit.edu.
  • Built in: Squeak, a version of Smalltalk. Scratch 3.0, released in January 2019, runs in a web browser and on tablets.
  • Audience: mainly 8 to 16 year olds, by the designers’ account.
  • Funding: the US National Science Foundation, Microsoft, the Intel Foundation, Nokia and the Media Lab’s research consortia.

From Logo to Scratch

Scratch comes from the same tradition as Logo. Its designers said it was “deeply influenced and inspired by the work of Seymour Papert and Alan Kay”, and their 2009 paper restated Papert’s test for a children’s language: a “low floor” so that it is easy to get started, and a “high ceiling” so that there is room to grow. They added a third requirement, “wide walls”, meaning room for many different kinds of project, because “Satisfying the triplet of low-floor/high-ceiling/wide-walls hasn’t been easy.”

They gave three reasons why the first wave of school programming had faded. The early languages “were too difficult to use, and many children simply couldn’t master the syntax of programming”. Programming was taught through exercises “such as generating lists of prime numbers and making simple line drawings” that had nothing to do with young people’s interests. And it was often taught where nobody could help “when things went wrong”.

The group had worked with the LEGO Company for years on programmable bricks, including LEGO Mindstorms, and LEGO gave Scratch its central idea. Children with “a box full of” bricks start tinkering at once and build plans as they go, and the designers wanted programming to feel the same. The name comes from hip-hop DJs, who scratch records to mix sounds together; in Scratch, the paper explained, the mixing is of “graphics, animations, photos, music, and sound”.

How the blocks work

Every command is a block, and its shape is part of the grammar. Control structures such as forever and repeat are C-shaped, so other blocks go inside them. Blocks that report a value are shaped by the kind of value: ovals for numbers, hexagons for true-or-false conditions. A condition block’s hexagonal slot only takes a hexagon. “There is none of the obscure syntax or punctuation of traditional programming languages,” the designers wrote. A child cannot make a syntax error, because a block that would make one does not fit.

The blocks sit in colour-coded categories. The first version had eight: Motion, Looks, Sound, Pen, Control, Sensing, Operators and Variables. A script runs when you click it, and you can change it while it is running. Two scripts can run at the same time: “Want to create parallel threads? Simply create multiple stacks of blocks,” the designers wrote. “Our goal is to make parallel execution as intuitive as sequential execution.”

Code
when green flag clicked
set score to 0
forever
    change y by -10
    if touching paddle? then
        set y to 180
        set x to pick random 180 to -180
        change score by 1
    if y position < -150 then
        say game over
        stop all

That script, written out as text, comes from a paddle game in the 2009 paper. In Scratch itself it is a stack of blocks, and it uses a variable, a loop, a condition and random numbers without the programmer typing a line.

Sharing and remixing

The website was part of the design from the start. Every Scratch program has a Share button that uploads it to the site, where others can run it, comment on it and download it to change. In the 27 months after the launch, users shared more than 500,000 projects, and by 2009 more than 1,500 new ones arrived each day. Over 15 per cent were remixes of someone else’s work, which at first upset some authors, who complained that others were “stealing” from them. The site responded by crediting the original author on every remix.

The paper’s authors quoted Marvin Minsky’s remark that Logo “had a great grammar but not much literature”, and called the Scratch website “the beginning of a ‘literature’ for Scratch”. Volunteers translated the blocks into more than 40 languages by 2009. Schools and some universities, including Harvard and the University of California, Berkeley, used Scratch as a first step into programming.

Later history

Scratch 3.0, released in January 2019, replaced the earlier versions with one that runs in current web browsers and on tablets, with extensions for LEGO robotics, the micro:bit and other devices. MIT reported that 35 million children in more than 150 countries had used Scratch in its first decade. By July 2024 the Scratch website counted more than 135 million registered users and 164 million shared projects.

Scratch’s source code is public. The Squeak source of Scratch 1.4 is published by the Scratch Foundation under the GNU General Public License version 2, and the code of the current editor and its virtual machine is on GitHub under the GNU Affero General Public License version 3.

Sources

  • Mitchel Resnick, John Maloney, Andrés Monroy-Hernández, Natalie Rusk, Evelyn Eastmond, Karen Brennan, Amon Millner, Eric Rosenbaum, Jay Silver, Brian Silverman and Yasmin Kafai, “Scratch: Programming for All”, Communications of the ACM vol. 52 no. 11, November 2009, pp. 60-67 (modern article): the launch in May 2007 and work begun six years before; the age range; the Logo and BASIC era and the three reasons it faded; low floor, high ceiling and wide walls; the Lifelong Kindergarten group, LEGO and the name; block shapes and the categories shown in the editor; Squeak; the paddle-game script; projects shared, remixes and Minsky’s remark; translations and university use; Papert and Kay; funders. https://web.media.mit.edu/~mres/papers/Scratch-CACM-final.pdf
  • MIT News, “MIT Media Lab introduces Scratch 3.0”, 8 January 2019 (web, secondary): browsers, tablets and extensions; 35 million children in over 150 countries. https://news.mit.edu/2019/mit-media-lab-introduces-scratch-3point0-0108
  • MIT Media Lab, Mitchel Resnick profile (web, secondary): “His Lifelong Kindergarten research group developed the Scratch programming software and online community”. https://www.media.mit.edu/people/mres/overview/
  • Scratch Foundation, GitHub repositories (web, secondary): Scratch_1.4, “Source Code repository for Scratch 1.4”, README: “released under the Gnu General Public License version 2”, https://github.com/scratchfoundation/Scratch_1.4; scratch-gui and scratch-vm, licensed AGPL-3.0, https://github.com/scratchfoundation/scratch-gui
  • Scratch, “Community Statistics”, data dated 14 July 2024 (web, secondary): 135,078,559 registered users and 164,307,034 projects shared. https://scratch.mit.edu/statistics/

See also

Checked. Verified against primary sources and signed off by a person.