Category Archives: professional

What is the best programming language for a child progressing from Scratch?

Someone asked me what is the best programming language for a child to learn after starting (and having success) with Scratch.

Scratch is a visual programming language which actually runs on Smalltalk, though its users do not need to know this. Scratch 2.0 seems to be written in Adobe Flash so you can create and program projects in a web browser. As far as I can tell though, there is no obvious and natural progression from Scratch to a code-centric programming language.

I guess the first answer is not to move away from Scratch until you need to. You can do a lot with Scratch, as the many shared projects demonstrate.

Still, I agree that it makes sense to learn text-based programming before too long. What is the best one for a child to learn, not necessarily with computer science or a professional career in mind, but just to take the next step and create some cool games and applications?

I find myself leaning towards Microsoft’s C#. The reason is that there is a capable free version and  you can add XNA Game Studio for game development. C# is an excellent language and has some family resemblance to other languages including C, C++, Java and JavaScript, and Visual Studio is a strong IDE that is perhaps more approachable than say Eclipse or Netbeans.

Snags with C# are that Visual Studio only runs on Windows, the language is proprietary to Microsoft (though Mono is free and open source) and it is not ideal if you want to run on the Mac, or Google Android or Apple iPad.

That said, I could also make a case for Java, or JavaScript, or Python.

I would value suggestions though: what would you recommend to a teenager?

Adobe’s Falcon JS: Compile Flex code to HTML and Javascript

Adobe has issued further information about its intention to donate the Flex SDK, which builds Flash applications from XML and ActionScript, to the Apache Software Foundation. Specifically, the donation will include:

  • BlazeDS, the free version of LiveCycle Data Services
  • Falcon, the new Flex compiler due to be completed in 2012
  • Falcon JS, a previously unannounced project

Of these, Falcon JS is the most eye-catching. This is an “experimental cross-compiler from MXML and ActionScript to HTML and JavaScript.” In other words, Falcon JS has the potential to give developers a migration path from Flash to HTML clients. Note that it is described as a cross-compiler rather than a porting tool, so it may well be that the output is not easily edited. The Google Web Toolkit works like this, converting Java to JavaScript but not in a form that anyone is expected to edit. Adobe also adds:

We have undertaken some experimental work in this area, but remain unsure as to the viability of fully translating Flex-based content to HTML. The Falcon JS cross-compiler, referenced above, represents this early work.

What about the most sensitive of Adobe’s statements, that HTML is the long-term solution for enterprise applications? Adobe says:

In time (and depending upon your application, it could be 3-5 years from now), we believe HTML5 could support the majority of use cases where Flex is used today.

and adds:

We intend to make investments in HTML-related technologies, so that we can help advance HTML5 to make it suitable for enterprise applications.

I am not sure to what extent the new statement will ease the worries of Flex developers; but at least Adobe is clear about its intentions. While there are benefits in the Flex SDK moving to Apache, overall the message is that Adobe is hastening towards HTML 5. I am surprised, considering the progress the company has made in creating a strong cross-platform toolkit for mobile and desktop applications. Although no-one should doubt that Adobe will continue to support and evolve Flex as a development platform, it has in effect declared it to be a legacy technology, and I would guess that the effect will be to depress the level of activity there.

GPU programming coming to low-power and mobile devices – from EU Mont Blanc supercomputer to smartphones

Supercomputing and low-power computing are not normally associated; but at the SC11 Supercomputing conference the Barcelona Supercomputing Center (BSC) has announced a new supercomputer, called the called the Mont-Blanc Project, which will combine the ARM-based NVIDIA Tegra SoC with separate CUDA GPUs. CUDA is NVIDIA’s parallel computing architecture, enabling general purpose computing on the GPU.

The project’s publicity says this enables power saving of 15 to 30 times, versus today’s supercomputers:

The analysis of the performance of HPC systems since 1993 shows exponential improvements at the rate of one order of magnitude every 3 years: One petaflops was achieved in 2008, one exaflops is expected in 2020. Based on a 20 MW power budget, this requires an efficiency of 50 GFLOPS/Watt. However, the current leader in energy efficiency achieves only 1.7n GFLOPS/Watt. Thus, a 30x improvement is required.

NVIDIA is also creating a new hardware and software development kit for Tegra + CUDA, to be made available in the first half of 2012.

image

The combination of fast concurrent processing, low power draw and mobile devices is enticing. Features like speech recognition and smart cameras depend on rapid processing, and the technology has the potential to make smart devices very much smarter.

NVIDIA has competition though. ARM, which designs most of the CPUs in use on smartphones and tablets today, has recently started designing mobile GPUs as well, and its Mali series supports OpenCL, an open alternative to CUDA for general-purpose computing on the GPU. The Mali-T604 has 1 to 4 cores while the recently announced Mali-T658 has 1 to 8 cores. ARM specifically optimises its GPUs to work alongside its CPUs, which must be a concern for GPU specialists such as NVIDIA. However, we have yet to see devices with either T604 or T658: the first T604 devices are likely to appear in 2012, and T658 in 2013.

New OpenACC compiler directives announced for GPU accelerated programming

A new standard for accelerating C/C++ programming with compiler directives has been announced at the SC11 Supercomputing conference in Seattle. The new standard is called OpenACC  and has been created by NVIDIA, Cray, PGI (Portland Group) and CAPS enterprise.

OpenACC compiler directives are code annotations that enable the compiler to parallelise code while ensuring thread-safety. The big difference between OpenACC and the existing OpenMP standard is that OpenACC primarily targets the GPU rather than CPU, whereas OpenMP is generally CPU only. That said, OpenACC can also target the CPU so it is flexible; the idea is that it will adapt to the target system.

image

OpenACC is “defined to be interoperable with OpenMP” according to the FAQ and the OpenACC CEO hopes for some future integration, though it seems to have been developed independently which may cause some tension.

OpenACC is expected to ship during the first half of 2012 on compilers from PGI, Cray and CAPS Enterprise. The NVIDIA involvement may make you wonder whether it is GPU-specific; the answer is “maybe”. The FAQ says:

Will OpenACC run on AMD GPUs?

– It could, it requires implementation, there is no reason why it couldn’t

Will OpenACC run on top of OpenCL?

– It could, it requires implementation, there is no reason why it couldn’t

Will AMD/Intel/MS/XX support this?

– As this is just announced we can’t speak to the rate of external adoption or participation.

Will OpenACC run on NVIDIA GPUs with CUDA?

– Yes. Programmers may wish to develop some code using directives, and more sophisticated code using CUDA C, CUDA C++ or CUDA Fortra

Spot the Yes in the above! Still, you can scarcely blame NVIDIA for supporting its own GPU family; and I have been impressed with how the company works with the scientific and academic community to realise the potential of massively parallel computing.

OpenACC is about democratising parallelism, rather than advancing the state of the art. Best optimisation is obtained by more complex programming, but directives make some remarkable performance improvements easy to achieve.

Developing for Windows Phone: what’s new

One thing that is easy to overlook in all the talk about Windows Phone, Nokia, and Microsoft’s prospects against iPhone and Android, is that the Windows Phone developer platform has substantially improved with the 7.1 SDK – the phone is 7.5 but the SDK is 7.1, just to confuse you.

Here are a few highlights from the list of what’s new:

Multitasking. Apps still do not continue to run when they do not have the focus. However, Microsoft has implemented several features to make it look as if they do. This includes background agents, background audio (another kind of agent), scheduled tasks, background file transfers, and fast application switching. Although apps do not execute in the background, they do stay in memory if free space allows, so that resume is near-instant.

Silverlight 4. The version of Silverlight implemented in Windows Phone is now Silverlight 4, though there are some differences between Silverlight on the desktop and Silverlight on the phone, including the fact that there is no Silverlight in the browser.

Apps that combine Silverlight and XNA. You can now render both XNA and Silverlight content in a single combined Windows Phone app.

image

Visual Basic and XNA. XNA was C# only in the initial release. No longer.

Better sensor support. You can now access the compass and gyroscope, and use a combined motion API.

Socket support. Use TCP and UDP socket protocols.

Network information. This is actually critical to creating well-behaved apps. New network information classes let you get network status and capabilities. You can also register for network availability change events.

Two-sided Live Tiles. Live Tiles in Windows Phone have two sides and flip automatically, effectively giving more space to show information.

Advertising SDK. Sign up to include ads from Microsoft Advertising in your app.

IE9 WebBrowser Control. You cannot embed your Silverlight app in the browser, but you can embed the WebBrowser control in your Silverlight app, now with IE9’s fast Javascript and HTML 5 features.

Local Database. A local database API is now included in Windows Phone. Sadly this is not Sqlite; I’m guessing it is a variant of SQL Server Compact Edition. You access and manipulate data with LINQ to SQL – no Entity Framework ORM (Object Relational Mapping) on the phone, though LINQ to SQL is also an ORM framework. There is no way other than LINQ to execute SQL locally.

New Launchers and Choosers. Launchers and Choosers let your app present picklists from data stored elsewhere in the phone. You can now choose an address, invite players to a game session, show a location on a map, or show map directions.

Read-only access to Contacts and Calendar.

Encrypted credential store. This enables you to store login details securely using a built-in API.

Programmatic access to the camera. This includes real-time access to the raw frames so you can create apps that use the camera.

Pictures and Search Extensibility. This lets your app interact with the Pictures hub and with the built-in search. Users who search Bing can launch your app from the results if there are matches.

New on-screen keyboards. There are now specialist keyboards for numbers and formulae.

Additional language support including East Asia. Overall there are 16 additional cultures available including font support.

Overall it adds up to a major update for developers. If you tried the first Windows Phone SDK and found too many annoyances, it might be worth a second look.

Is this the best mobile developer platform? I had this discussion today with Keith Varty, developer evangelist for Nokia. After rather enjoying a brief go with Xcode for iOS, I am not sure; there is no simple answer. It is certainly a candidate though: you get the excellent C# language, the mature Visual Studio IDE, and strong frameworks for both form-based and gaming applications. Then again you may miss those beautiful iOS controls.

Adobe’s cloud plans: most customers will migrate, pay more, get more

I’ve been listening to some of the sessions from Adobe’s Financial Analyst meeting in New York City yesterday. Since this event was focused on financials, Adobe talked in detail about how it intends not only to win its customers over to a cloud model, but also to make more revenue from them. I found it fascinating.

First, a little background. Adobe announced its Creative Cloud at the MAX event in Los Angeles last month. I was there, and while it was obvious that the announcement was significant, I did not appreciate until yesterday how profoundly the company is changing its business model.

Adobe has its own take on what cloud computing means. There are no plans for Creative Suite – which bundles products including Photoshop, Dreamweaver, Flash and Premier Pro – to become software as a service in the manner of Google Apps or Salesforce.com. Rather, the Creative Cloud is primarily two things:

1. A new purchase model for Creative Suite and associated tablet apps, based on subscription rather than perpetual licencing.

2. A set of cloud-based services which extend the features of the desktop applications. These services include storage of your projects, synchronisation across different desktop PCs and mobile devices, font licensing, digital publishing, analytics, and website building.

There is also a community aspect. I grabbed a screen from one of the presentations, and on the right you can see that the customer has a Twitter-style “followed” and “following” count, as well as status activity reported.

 image

In the main part of the screen, you can see the desktop apps she has installed “on this machine” – implying some link between cloud and local machine – tools “you do not have yet” which can be installed from the cloud, and a set of Android and Apple iOS touch apps also marked “click to install”.

One thing Adobe made clear to its analysts is its intention that all its Creative Suite customers will eventually move to the Creative Cloud, and that the majority of its Creative Suite business will be cloud subscription within 4 years.

Why will you move? Well, Adobe is going to reserve some benefits for subscription customers. During the Q&A at the end of the day, the execs were asked whether Adobe Edge and Muse will be in Creative Suite 6, the next major version. Edge is for designing HTML 5 animations, while Muse is for building web sites without writing code. This is what Senior VP David Wadhwani said:

We’ve announced they will be available in the CS6 timeframe. They will be available as point products, as subscriptions, and in the Creative Cloud. Our current thinking is not that we’ll be adding them to Creative Suite. Creative Cloud is what we believe adds more value to our customers and we want to continue to drive people in that direction.

It is not just adding value to customers though, it is adding value to Adobe as well. Adobe presented figures which spell this out (it was a financial meeting, remember). The example was CS 5.5 Design Premium.

image

This particular suite costs as much as $1,899 today if you buy a perpetual licence, or as little as $399.00 as an upgrade from CS 5 (still a perpetual licence). Adobe has a sliding scale of upgrade prices, which rise according to the age of your current version, though apparently this is changing and you will no longer get upgrade prices more than two versions back (I think this means that CS 4.x versions will not get upgrade pricing for CS 6).

The existence of upgrade prices makes calculating revenue per customer over time rather complex, because it depends how often they upgrade. CS is now on an annual release cycle, and according to Adobe this means the revenue from a perpetual licence customer might be as much as $3,894 over six years, or as little as $1,424 if they are an existing customer who upgrades just once at the beginning of that six year period.

On average, Adobe says, its perpetual licence Creative Suite customers pay $30.00 per month “over all CS suites and geographies”.

By contrast, the Creative Cloud subscription would be either $49 or $69 per month (I am not quite sure what extra you get for the $20) and over 6 years, allowing for some customers to drop out, Adobe reckons it will get $40.00 revenue per month.

In other words, it is projecting that its Creative Suite customers will pay on average 33% more under the new Creative Cloud model, than they do today.

I am not clear how dealer margins affect these figures; but Adobe did say that it will continue to work with its retail channel and partners, so that will continue at some level.

One analyst asked why customers will be willing to pay more than they do at the moment. Here is Wadhwani’s answer:

There’s a lot of new value in the creative cloud. You get all of the desktop tools as they’re ready. You get all of the touch tools. When our creative Suite customers are starting to use tablets they want automatic synchronisation and the ability to use those directly with the desktop tools. That’s one of the functions the creative cloud includes.

There’s a lot more in there around community, there’s a lot more in there around training. We’ve talked about Adobe gurus, people that are recognized names in the community participating and helping our customers with new ideas. We’ve also introduced the idea of some segments of the digital publishing suite and business catalyst and some of our publishing services being available,

And recently we’ve acquired a company called Typekit which addresses one of the biggest issues as people move to being more digital, which is how do they manage and licence fonts? That whole aggregate value is substantially more than what they get with a single version of the creative suite.

Is that worth on average 33% more? It is hard to judge as it depends on the individual customer’s pattern of work.

Whatever you think of this strategy, it is in line with something Adobe has been pushing hard in recent years, which is to drive for recurring revenue rather than one-off purchases. In fact, this is stated in the financial presentation. Apparently, 40% is already recurring revenue, but the company plans to transition the majority of overall Adobe business to recurring revenue within 4 years.

Google App Inventor not dead, MIT to offer public service in 2012

Google’s App Inventor is a visual and mostly browser-hosted development environment for Android. There is a design tool:

image

and a "Blocks Editor” which lets you create program logic using visual blocks:

image

App Inventor is a great concept but in practice most developers find it easier to use more traditional tools to code their applications. Earlier this year Google said that App Inventor would close, but that the code would be open sourced in partnership with MIT Media Labs. This is a kind of homecoming, since it was Professor Hal Abelson at MIT who proposed it as a project while on sabbatical with Google in 2008.

Google now says, in an email to App Inventor users:

Sometime in the first quarter of 2012, the Center plans to provide an App Inventor service for general public access, similar to the one Google is currently running.

Since App Inventor will continue running at Google until December 2011, this may mean only a short interval during which App Inventor will be unavailable. There will be no migration of projects though, so you have to download any existing projects and later upload them to the new service.

App Inventor is inspired by Scratch, an existing open source MIT project which is used to good effect in education.

What next for Adobe Flash? Think runtime not plugin

Adobe is stating that mobile Flash will no longer be developed:

Our future work with Flash on mobile devices will be focused on enabling Flash developers to package native apps with Adobe AIR for all the major app stores. We will no longer continue to develop Flash Player in the browser to work with new mobile device configurations (chipset, browser, OS version, etc.) following the upcoming release of Flash Player 11.1 for Android and BlackBerry PlayBook. We will of course continue to provide critical bug fixes and security updates for existing device configurations. We will also allow our source code licensees to continue working on and release their own implementations.

Although this seems like a major shift in strategy, Adobe has been moving in this direction for some time. At the MAX conference last month the company was clear that most web developers can be expected to use HTML 5 rather than Flash most of the time, reserving use of the plug-in for video, games and certain kinds of application. As for mobile, all the talk was about AIR and the captive runtime, an approach similar to the iOS packager which bundles the Flash runtime into your application so that no plug-in or additional download is required.

This approach is now explicit, and I reckon we can further conclude that if the Flash plugin for mobile is being abandoned, then the Flash plugin for the desktop is also less important than before. Mobile browsing is huge, and likely to grow, so developing web pages for Flash is unattractive other than in cases where there is an easy way to direct mobile browsers to a non-Flash alternative. Flash as a browser plugin will now decline forever, which is a good thing for web standards even if it is not necessarily a good thing for web developers, who must face the challenge of cross-browser development.

So what is Flash now? It is still Adobe’s runtime, and the client for its media services, and in that role it remains significant. Thanks to Adobe’s packaging work, you can take your Flash or Flex application and deploy it to most desktop and recent mobile platforms, though not to Windows Phone or older Android devices. Could you not use HTML 5, JavaScript and PhoneGap instead? Maybe in some cases; but Flash is a richer, faster and more consistent platform, as well as benefiting from Adobe’s design and development tools.

See also my piece for the Register: Down but not out: Flash in an HTML5 world.

Update: Added official Adobe link for statement on mobile Flash.

Adobe “shifting its business model”: more publishing, less programming

Adobe has announced a shift in its business strategy, together with the loss of around 750 employees.

So what is changing? Adobe says it will be focusing on digital media and digital marketing, while investing less in “certain enterprise solution product lines.” In line with this strategy, Adobe acquired video advertising company auditude last week.

Here are the things which Adobe says are “important elements” in its new approach:

  • Creative Suite extended with tablet apps and delivered through the cloud
  • Greater investment in HTML 5: Dreamweaver, Edge and PhoneGap
  • Flash positioned for “advanced” web, video, and mobile apps
  • Digital publishing solutions
  • Video advertising
  • Document services such as electronic contracts and signatures

So what will Adobe be doing less? This is harder to discern as the releases, naturally enough, say less about it. The key remark is that:

the company will reduce its investment, and expected license revenue, in certain enterprise solution product lines

We can conclude, I guess, that the Digital Enterprise Platform once known as LiveCycle is going to get less attention as the company focuses more on digital content and less on providing a platform for enterprise applications. I would guess that this will impact the middleware services more than things like the Flex framework and Flash Platform tools, but I am speculating. More information is coming in a financial analyst meeting tomorrow in New York.

Eclipse and Xtend: some confusion in getting started

Last weekend there was some publicity around Xtend, an Eclipse project which extends Java with new language features. Xtend now has a new landing page, as announced by the lead architect Sven Efftinge.

I did intend to post about this yesterday, but I wanted to see it in action first, so I tried to download it and have a look. I believe this is a case where those who wrote the new landing page are too close to the project and made some assumptions, because I did not find it obvious how to proceed.

If you follow the Download link you are invited to paste one of the three URLs into the Eclipse update manager.

image

As a newcomer to the project, I did not want three URLs to choose from, I wanted just one. I picked Release as in general this one is likely to work.

Now, the instructions say:

To install the Xtend plugins open the update manager and paste one of the URLs on the right into the field ‘Work with’ and select the Xtend SDK.

The update manager actually presents you with a long list of updates, none of which say Xtend. I took a stab at what I thought was the right thing.

image

The All-In-One includes the Xtend SDK, which is what I want, right?

Wrong. After installation I could not find the tutorial which the docs said would be available.

I did some messing around with Eclipse and got the occasional error like this one:

image

Then I realised that I should have looked under the TMF Xtext-2.1.0 tree, which is where the correct Xtend SDK resides:

image

Except that if you find this helpful post by  Max Rohde you will know:

The other packages need to be selected since otherwise the Xtend editors will not work.

So you should select all of TMF Xtext-2.1.0 (or the latest release). Easy when you know, but not obvious since the word Xtend does not appear in the top node of the tree.

I was then able to create the tutorial project. I opened HelloWorld.xtend and got this:

image

Ah, but you have read Rohde’s post so you know this is expected and that you should run this as a JUnit Test. However it does not have any output. To see some output, you have to run one of the other examples, like Xtend08_RichStrings, or perhaps add:

sayHelloToSystemOut2(‘Tim’)

to the testHelloWorld() method in HelloWorld.xtend.

image

OK, it works.

So what is Xtend? It is essentially a code generator which lets you write in Xtend and generate Java. You can see the generated code in the tutorial project under xtend-gen.

image

Xtend adds some nice features: type inference, property syntax, closures, switch expressions with no fall-through, template expressions, extension methods, and multiple dispatch.

I can imagine C# creator Anders Hejlsberg smiling here, as most of this is already in C# in some form or other.

But is Xtend the right way to bring these features to Java? I am not convinced so far. It is an interesting Eclipse project, but it may be more significant in speeding the implementation of features like these into Java itself, than as a mainstream approach to writing applications. Xtend is a kind of hybrid approach, where you will be switching between Java and Xtend while you code and debug your application, and I suspect it would get frustrating.

There is also the question of widespread community support – beyond Eclipse.

Finally, it would be good if the new landing page could be made more helpful for those getting started.