Friday, June 13, 2014

Cloud9 and Ceylon

Cloud9

I recently stumbled across a really impressive online full fledged coding IDE called Cloud9. By signing up for a free account you get as many public workspaces as you want, plus, a quite complete Linux environment including a really outstanding terminal. This is all made in javascript and HTML5, so this is 100% portable. A recent browser is all you need.

Cloud9 proposes workspace templates, which includes node.js, ruby on rails, php, pyhon and some others. Me being on the Java side, I initially thought it was missing this behemoth, but found out that the JDK comes pre-installed, along with a few tools like Ant.

I find there is no better environment for prototyping some stuff. Nothing to install.

I might write a complete article on Cloud9 in the near future.

Ceylon

I'm a big fan of Gavin King, all the way since the beginning of Hibernate a long time ago. I was quite curious when I heard he was on a special project at Red Hat which was about creating a new language for the JVM. Now that version 1.0.0 is out, it's time to put our hands dirty and check this out. 

Installing Ceylon on Cloud9


From here I assume you already have your Cloud9 account and you created a custom workspace.

Prerequisites for Ceylon are a JDK plus Ant, and they come preinstalled in Cloud9. So lets download the package and install it at convenient place (don't forget to add Ceylon binaries to the $PATH variable in ~/.bashrc):

We now have a working Ceylon installation.

Creating the Hello World project



Executing the project

First execution will provoke the following exception:
This is a common error on Cloud9 when installing/running custom binaries. Access controls restrict write operations in core folders.
We need to override where the cache folder will reside:
A new execution will give us a new error:
It appears that commenting out the documentation lines in run.ceylon fixes the problem.

Next steps

This is just the beginning. Full Ceylon applications can probably be build this way. By natively linking to GitHub, Cloud9 makes a wonderful environment to prototype and test ideas.