Google Blockly - A Graphical Language with a Difference
Written by Lucy Black   
Tuesday, 12 June 2012

Google Blockly is a graphical language implemented in JavaScript which can compile to JavaScript, Dart or Python. It is open source and a great way to learn to program and an easy way to generate web code.

There are aspects of Google that increasingly don't make sense. It is difficult to know if this latest project is the result of one part of Google not talking to another, or if it is an inspired piece of work.

A short while back Google released a graphical programming language based on Scratch that could be used to create Android apps - App Inventor. It was, and is, a brilliant idea that could be used to encourage beginners to learn to program and to create apps for Android. However, during the clear out of Google labs, the project was dumped, or rather dropped into the lap of MIT along with some money to see whether it could support the project. As part of MIT, App Inventor might be of interest to the educational community, but the professional world just can't take it as seriously as if Google had kept its weight behind it. In many ways. the removal of App Inventor from Google due to its "spring cleaning" operations was the biggest loss of all.

Blockylogo

Now, only a few months after dumping App Inventor, we have Google Blockly, which looks and feels like a version of Scratch. You program by dragging and dropping code blocks onto a design surface. So nothing new -  but there are some really significant differences between Blockly and Scratch and App Inventor for that matter.

Blockly is written in JavaScript and as such is designed to run in a web page. It can also generate code which can be run standalone. The generated code can be JavaScript, Dart or Python.

 

blockysample

 

As it can be embedded in a web page and is written in JavaScript, it can be customized to allow end users to program web apps. As the FAQ says:

For example, in Gmail, you can use Blockly to create email filters that do things like, "If Bob emails me three times in less than an hour, and each email contains the word 'deadline', delete all his emails except the first one."

Blockly is currently in its early stages of development and at the moment at least it is only suitable for generating short scripts - to quote the FAQ:

"Please do not attempt to maintain the Linux kernel using Blockly."

It is suggested that, as well as allowing non-programmers to start to program, Blockly could be very handy if you wanted to create a quick script and then switch to JavaScript to complete or extend it.

 

blockyhelloworld

Hello world - five times in Blockly

 

You can try Blockly using one of the demo web pages provided. You can also download the code and install it on your own server. As the FAQ suggests, this hasn't been made a plug-and-play installation because it isn't polished enough for a novice to use:

"Blockly is a technical preview aimed at application developers. At this point it is not an end-user application. Users who are not comfortable with syncing Subversion would most likely be disappointed in the current codebase. Blockly is not an executable that can be double-clicked and played with."

Blockly is a really interesting idea and it could do a lot for both beginners and programmers who want to create quick prototypes or include a scripting element in their web apps.

As long as Google doesn't throw this one out in a fit of reorganization and spring cleaning, this is a welcome new language.

Blockylogo

Good luck Blockly.

More Information

Google Blockly

Related Articles

A Programmer's Guide to Scratch

Scratch not to be sniffed at!

Getting started with Android App Inventor

App Inventor returns to MIT

MIT App Inventor Back Online

on{X} - Good for Non-Programmers and Programmers

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin,  or sign up for our weekly newsletter.

 

Banner


Grafana 11 Improves Metrics
11/04/2024

Grafana Labs, creators of the Grafana open-source metrics analytics and visualization suite, has announced the preview release of Grafana 11 with improvements to make it easier to view metrics, and ch [ ... ]



Google Introduces JPEG Coding Library
15/04/2024

Google has introduced Jpegli, an advanced JPEG coding library that maintains high backward compatibility while offering enhanced capabilities and a 35% compression ratio improvement at high quality co [ ... ]


More News

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Tuesday, 12 June 2012 )