Jump to content

Blockly

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Thomas-pluralvonglas (talk | contribs) at 11:24, 9 May 2017. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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

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

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.

Customising Blockly

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 using Blockly

Blockly is used in a number of projects:

  • Blockly Games, a set of educational games that teach programming concepts such as loops and conditionals.[5][6]
  • MIT's App Inventor, to create applications for Android.[7]
  • Code.org, to teach introductory programing to millions of students in their Hour of Code program.[8]
  • micro:bit JavaScript Blocks Editor (PXT) [1]
  • Microsoft Block Editor for the BBC micro:bit [2]
  • CoderZ, an online learning environment developed by Intelitek where students learn STEM with virtual and real robots. Compatible with the LEGO Mindstorms EV3.
  • LearnToMod, to teach computer science to kids through the context of making Minecraft modding simpler.[9]
  • Wonder Workshop, to control their Dot and Dash educational robots.[10]
  • the Open Roberta project, to program Lego Mindstorms EV3 robots.[11]
  • snapp, to create apps and prototypes for iOS and Android.[12]
  • CodeSpells, a video game on Steam which allows players to craft magical spells to manipulate a 3D world using Blockly code.[13]
  • the AMADEOS project,[14] as a supporting facility tool[15] to design System of systems.
  • MakerSCAD, a web based parametric 3D modeling tool which allows users to create 3D objects using Blockly code.[16]
  • RoboBlockly, a web-based robot simulation environment for learning coding and math.[17]
  • CoSpaces, a multi-platform tool which enables teachers, parents and their children to develop their own 3D & virtual reality games[18]

Features

  • 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[19]
  • Step-by-step code execution for tracing and debugging code[20]
  • Localised into 50+ languages[21]
  • Support for left-to-right and right-to-left languages[22]

See also

References

  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".
  4. ^ "Google Blockly - A Graphical Language with a Difference". i-programmer.
  5. ^ "Google Introduces Kids to Coding Through Blockly Games Project". EWeek.
  6. ^ "Blockly: Maze Archives - BrainPOP Educators". BrainPop.
  7. ^ "MIT App Inventor 2". MIT.
  8. ^ "Translate Code.org". Code.org.
  9. ^ "LearnToMod Minecraft Modding". ThoughtSTEM.
  10. ^ "Wonder Workshop Blockly". Wonder Workshop.
  11. ^ "Open Roberta Lab". Fraunhofer IAIS. Archived from the original on 2015-06-25. {{cite web}}: Unknown parameter |deadurl= ignored (|url-status= suggested) (help)
  12. ^ "snapp: Create Apps Visually". Foneclay Inc. Retrieved 16 September 2015.
  13. ^ "CodeSpells". ThoughtSTEM.
  14. ^ "AMADEOS Project".
  15. ^ "Blockly4SoS".
  16. ^ "MakerSCAD". MakerSCAD.
  17. ^ "RoboBlockly".
  18. ^ "CoSpaces".
  19. ^ "Blockly Demo:".
  20. ^ "Blockly Demo: JS Interpreter".
  21. ^ "Localisation statistics for the Blockly core module".
  22. ^ "Blockly Demo: RTL".
  • Official website
  • BlocklyDuino. Several developers have extended Blockly to support the Arduino family of MCU boards, allowing people an easier means of developing Arduino C applications. These new versions of Blockly are often called "BlocklyDuino". BlocklyDuino is a great STEM teaching tool for bridging students from Scratch programming over to Arduino C programming, and perhaps later to C/C++ programming. Several organizations (including UCSD, GitHub and TechMania) offer free access to BlocklyDuino servers. There is even one called "TUNIOT" by EasyCoding that supports WiFi (IoT) program development on the NodeMCU, an ESP8266 MCU board that is Arduino C/IDE compatible using the Arduino ESP8266 Core from GitHub. Really cool stuff.