Blockly

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Blockly is a client-side JavaScript library for creating visual block programming languages and editors. It is a project of Google and is open-source under the Apache 2.0 License.[1] It typically runs in a web browser, and visually resembles Scratch. Blockly is also being implemented for Android and iOS; not all web browser based features are available for Android/iOS.

Blockly uses visual blocks that link together to make writing code easier, and can generate JavaScript, Python, PHP or Dart code. It can also be customised to generate code in any textual computer language.[2]

History[edit]

Development of Blockly started in summer of 2011, and the first public release was at Maker Faire in May 2012. Blockly was originally designed as a replacement for OpenBlocks in App Inventor.[3] Neil Fraser started the project with Quynh Neutron, Ellen Spertus and Mark Friedman as contributors.

User interface[edit]

The default user interface of the Blockly editor consists of a toolbox, which holds available blocks, and a workspace, where the user can drag (from the toolbox) and rearrange blocks. The workspace also includes, by default, zoom icons and a trashcan for deleting blocks.[4] Note that the editor can be customised by visual language developers to customise the editing features available, as well as limiting which blocks are available.

Customization[edit]

Blockly includes a set of visual blocks for common operations, but 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 existing visual blocks; the intention is to make creating new blocks easier.

Applications[edit]

Blockly is used in a number of notable projects, including:

  • MIT's App Inventor, to create applications for Android.[5]
  • Blockly Games, a set of educational games that teach programming concepts such as loops and conditionals.[6][7]
  • Code.org, to teach introductory programing to millions of students in their Hour of Code program.[8]
  • Rapid Router from Code For Life, to teach programming concepts to Primary Schools pupils.[9]
  • RoboBlockly, a web-based robot simulation environment for learning coding and math.
  • Verge3D leverages Blockly as a scripting environment for WebGL applications (dubbed Puzzles).[10]
  • Wonder Workshop, to control their Dot and Dash educational robots.[11]

Features[edit]

  • Web based using SVG, no Flash
  • Completely client side JavaScript
  • Support of major web browsers including: Chrome, Firefox, Safari, Opera, IE
  • Mobile support on Android and iOS
  • Support for many programmatic constructs including variables, functions, arrays
  • Minimal type checking supported, designed for weakly typed languages
  • Easy to extend with custom blocks. Use the block factory to make Blockly blocks with Blockly
  • Clean code generation[12]
  • Step-by-step code execution for tracing and debugging code[13]
  • Localised into 50+ languages[14]
  • Support for left-to-right and right-to-left languages[15]

References[edit]

  1. ^ "Google Blockly Lets You Hack With No Keyboard". WIRED. 
  2. ^ "Google's Blockly Teaches You to Create Apps". NBC Bay Area. 
  3. ^ "Google Groups". Groups.google.com. Retrieved 16 January 2018. 
  4. ^ "Google Blockly - A Graphical Language with a Difference". I-programmer. 
  5. ^ "MIT App Inventor 2". MIT. 
  6. ^ "Google Introduces Kids to Coding Through Blockly Games Project". EWeek. 
  7. ^ "Blockly: Maze Archives - BrainPOP Educators". BrainPop. 
  8. ^ "Translate Code.org". Code.org. 
  9. ^ "Rapid Router". Ocado Technology. 
  10. ^ "Verge3D 1.0.2 Brings Instant Web Publishing, New Puzzles and More!". Soft8Soft. 
  11. ^ "Wonder Workshop Blockly". Wonder Workshop. 
  12. ^ "Blockly Demo". Blockly-demo.appspot.com. Retrieved 16 January 2018. 
  13. ^ "Blockly Demo: JS Interpreter". Blockly-demo.appspot.com. Retrieved 16 January 2018. 
  14. ^ "Localisation statistics for the Blockly core module". Translatewiki.net. Retrieved 16 January 2018. 
  15. ^ "Blockly Demo: RTL". Blockly-demo.appspot.com. Retrieved 16 January 2018. 

External links[edit]