Up until yesterday, I’d not seen a programming language which would go from a graphic oriented (pseudo Scratch-like) environment to a conventional source code view, from browser based execution to microcontroller execution, to mobile phone app execution. It was possible however to achieve all of this within a matter of hours!
TouchDevelop is a programming language created by Microsoft – it can instantly run in a web browser if Internet connectivity is available, otherwise it can be locally installed too to run as a local web server. I tested a quick local install on Linux but of course it can be installed on Windows too.
TouchDevelop will be used with the micro:bit that Element14 and the BBC have developed together with Microsoft, ARM, Freescale and others as well as product champions including the IET and Cisco.
What can it do? How does it work?
Some key characteristics are:
• Browser based development environment (private server, or public cloud)
• Cloud storage of your programs
• Development environment optimised for touch interface for rapid copy/paste/delete and so on
• Forward/backward conversion between graphical block coding and text coding at any time
• Run anywhere - in a browser (i.e. any platform) or on hardware (microcontroller or mobile app for Android/IOS/Windows Phone)
• Will be supported for the micro:bit
• Open source – run local copies on any platform and OS (Linux, Windows, etc), and fork it and improve it!
This is how to use it to write code:
The nice thing is that programs can be developed anywhere and retained in a cloud provided you have a suitable account (based on delegated authentication so it doesn’t have to be a Microsoft account).
Although the install instructions were for Windows, it was relatively straightforward to install on Ubuntu and get coding.
Here is my attempt at turtle graphics:
There is also Arduino capability (see example code screenshot below) that can convert your program into C++ that can be used by the usual Arduino software tools – I didn’t get that compiling on Linux but I see no reason why this wouldn’t work with a little effort. The instructions for Windows are all published. With some more effort, other microcontroller platforms could in theory be supported since the output is standards based C++.
The screenshot above shows the blocks-based code view – clicking on the ‘plus’ symbol inserts a line. The syntax in blocks below changes dynamically as you create each row of the program.
Another option is to target your mobile device; if you have Android Studio and Apache Cordova installed then this is a quick affair (and I’ve never written a mobile app before) - here is the turtle program running on a Nexus device simulation:
As a personal opinion I think it is a far easier-to-use language than Scratch or Python, and the libraries and development environment are geared for modern scenarios where people want to be able to write code rapidly anywhere on any machine, even touch-based machines (e.g. iPads), and still have the flexibility to convert to the (relatively) low-level C++ so that native code can be built too, to run on as many different platforms as possible including resource-constrained ones such as Arduino.
The above was a very quick examination of TouchDevelop’s main features and what it could do. No real steps recorded since I was just exploring, but I think it is highly interesting and worthy of further investigation.
I think it is extremely powerful to have a single, simple language to learn for young and older people, and yet be able to target so many scenarios. The ability to write and access the code easily from any device is a significant advantage too.
A Getting Started guide will follow and will be indicated here so click on the Bookmark button if you’re interested to read it.