Blockly

{{short description|JavaScript library}}

{{Multiple issues|

{{More citations needed|date=July 2019}}

{{Promotional|date=November 2024}}

}}

{{Infobox software

| name = Blockly

| logo =

| logo caption =

| screenshot =

| screenshot_size =

| caption =

| author = Neil Fraser, Quynh Neutron, Ellen Spertus, Mark Friedman

| developer = Google, MIT

| released = {{Start date and age|2012|05}}

| latest release version = Q1 2022 Patch 3

| latest release date = {{Start date and age|2022|06|08|df=yes}}{{Cite web|url=https://github.com/google/blockly/releases/tag/blockly-v8.0.3|title = Release Q1 2022 Patch 3 · google/Blockly| website=GitHub }}

| repo = {{URL|github.com/google/blockly}}

| programming language = JavaScript

| engine =

| platform = Web browser

| included with =

| size = 150 KB

| language = English

| language count = 50

| genre = Library

| license = Apache License 2.0

| alexa =

| website = {{URL|developers.google.com/blockly}}

| standard =

| AsOf =

}}

Blockly is a client-side library for the programming language JavaScript for creating block-based visual programming languages (VPLs) and editors. A project of Google, it is free and open-source software released under the Apache License 2.0.{{cite magazine|url=https://www.wired.com/2012/06/google-blockly/|title=Google Blockly Lets You Hack With No Keyboard|magazine=Wired|last1=Metz|first1=Cade}} It typically runs in a web browser, and visually resembles the language Scratch.

Blockly uses visual blocks that link together to make writing code easier, and can generate code in JavaScript, Lua, Dart, Python, or PHP. It can also be customized to generate code in any textual programming language.{{cite web|url=http://www.nbcbayarea.com/blogs/press-here/Googles-Blockly-Teaches-You-to-Create-Apps-158935465.html|title=Google's Blockly Teaches You to Create Apps|website=NBC Bay Area|date=13 June 2012 }}

History

Blockly development began in summer 2011. The first public release was in May 2012 at Maker Faire. Blockly was originally designed as a replacement for OpenBlocks in App Inventor.{{cite web|url=https://groups.google.com/forum/#!searchin/blockly/starlogo/blockly/eG2kQ5tyGpM/_ETqcdxH1rsJ|title=Google Groups|website=Groups.google.com|access-date=16 January 2018}} Neil Fraser began the project with Quynh Neutron, Ellen Spertus, and Mark Friedman as contributors.

User interface

File:Blockly Conditions to celsius.png to Celsius]]

File:Blockly while loop.png

The default graphical user interface (GUI) of the Blockly editor consists of a toolbox, which holds available blocks, and where a user can select blocks, and a workspace, where a user can drag and drop and rearrange blocks. The workspace also includes, by default, zoom icons, and a trashcan to delete blocks.{{cite web|url=http://www.i-programmer.info/news/98-languages/4357-google-blockly-a-graphical-language-with-a-difference.html|title=Google Blockly – A Graphical Language with a Difference|last=Black|first=Lucy|date=12 June 2012|website=I-programmer|access-date=3 July 2019}} The editor can be modified easily to customize and limit the available editing features and blocks.

Customization

Blockly includes a set of visual blocks for common operations, and can be customized by adding more blocks. New blocks require a block definition and a generator. The definition describes the block's appearance (user interface) and the generator describes the block's translation to executable code. Definitions and generators can be written in JavaScript, or using a visual set of blocks, the Block Factory, which allows new blocks to be described using extant visual blocks; the intent is to make creating new blocks easier.

Applications

Blockly is used in several notable projects, including:

  • MIT's Scratch (since version 3.0), visual programming environment for education{{cite web|url=https://developers.googleblog.com/2019/01/scratch-30s-new-programming-blocks.html|title=Scratch 3.0's new programming blocks, built on Blockly|website=Google}}
  • MIT's App Inventor, to create applications for Android.{{cite web|url=http://ai2.appinventor.mit.edu/|title=MIT App Inventor 2|website=MIT}}
  • MIT's [https://coco.build CoCo], visual collaborative programming website for education.
  • Code.org, to teach introductory programing to millions of students in their Hour of Code program{{cite web|url=http://code.org/translate|title=Translate Code.org|website=Code.org}}
  • Microsoft's MakeCode, "a free online learn-to-code platform where anyone can build games, code devices, and mod Minecraft" {{cite web | url=https://www.microsoft.com/en-us/research/project/microsoft-makecode/ | title=Microsoft MakeCode | website=Microsoft }}{{cite web | url=https://www.microsoft.com/en-us/makecode | title=Microsoft MakeCode Computer Science Education | website=Microsoft }}
  • RoboBlockly, a web-based robot simulation environment for learning coding and math
  • PICAXE, to control their educational microchips{{cite web|url=https://picaxe.com/software/picaxe/blockly-for-picaxe/|title=PICAXE Blockly|author=|date=|website=PICAXE|access-date=5 July 2020}}
  • SAM Labs, in STEAM learn-to-code "education solutions"{{clarify|date=July 2022}}

Features

  • Web-based using Scalable Vector Graphics (SVG)
  • Completely client-side JavaScript
  • Support of major web browsers including: Chrome, Firefox, Safari, Opera, Edge
  • Support for many programmatic constructs including variables, functions, arrays
  • Minimal type checking supported, designed for dynamically typed languages
  • Easy to extend with custom blocks
  • Clean code generation{{cite web|url=https://blockly-demo.appspot.com/static/demos/code/index.html|title=Blockly Demo: Code|website=Blockly-demo.appspot.com|access-date=16 January 2018}}
  • Step-by-step code execution for tracing and debugging code{{cite web|url=https://google.github.io/blockly-samples/examples/interpreter-demo/step-execution.html|title=Blockly Demo: JS-Interpreter|website=Blockly Samples|access-date=24 February 2023}}
  • Localised into 100+ languages{{cite web|url = https://translatewiki.net/wiki/Special:MessageGroupStats/out-blockly-core#sortable:3=desc|title=Localisation statistics for the Blockly core module|website=Translatewiki.net|access-date=16 January 2018}}
  • Support for left-to-right and right-to-left languages{{cite web|url=https://google.github.io/blockly-samples/examples/rtl-demo/|title=Blockly Demo: RTL|website=Blockly Samples|access-date=24 February 2023}}

References

{{Reflist}}