Coding on a Chromebook

A few weeks ago, I invested in my very first Chromebook with the intent of writing a Chrome OS application for it. I purchased an ASUS Chromebook Flip. It’s a great little machine for using web based applications. In fact, I am writing this blog entry from it right now. One question I had though was, can I use this as a development machine? Well, it’s been kind of a mixed experience, so I’ll be writing about this here.

There are a few code editors available on the Chrome Web Store. I’ve highlighted what I think are the best choices below.

Chrome Dev Editor (More Info)

This editor is made by Google, so it seems like the most obvious choice to me. It supports developing applications using Dart and JavaScript. It’s actually quite nice. It has Git integration, it supports project work spaces, and you can deploy and run Chrome or web applications directly from the IDE.

The downside of this IDE is uncovered upon visiting its GitHub page.

Note: Chrome Dev Editor is no longer being actively developed. We’ll do our best to merge your pull requests.

Zed Code Editor (More Info)

This editor is more akin to a text editor, but with syntax highlighting for various programming languages. It also has limited Git integration, and supports editing code files in local or remote folders.

Caret (More Info)

This editor is also basically a text editor with syntax highlighting. From what I’ve read, it’s goal is to be just that, nothing more, nothing less. This means it does not have support for things like Git integration which isn’t necessarily a bad thing. I’d personally rather have a great editor instead of an okay editor w/mediocre Git support.


 

Unfortunately, at the time of this writing, I find writing code with all three of these editors to be a very awkward experience. With all three of these editors, if you actually want to execute the code you write, you are pretty much limited to using JavaScript, and HTML, or Dart. If you are okay with this, then fine, you are all set! If you are using something like TypeScript, it’s a bit more involved to make this work. This is where Linux comes in.

Crouton (More Info)

Crouton is a tool that essentially allows you to install Linux on your Chromebook. Once installed, it lives side by side with Chrome OS. This means you can install whatever tools you enjoy using on Linux there, but still have access to the files or projects you create in the Chrome OS environment.

In my case, I wanted to be able to use the latest versions of Git, Node.js, npm, and TypeScript. By default, Crouton installs Ubuntu 12.04 (Precise Pangolin). This is problematic when it comes to installing the latest version of Node.js, because it comes with a C++ compiler that isn’t capable of building the latest V8 JavaScript engine. They attempted to fix this by building node packages with Clang. Unfortunately there are no ARM builds for these distributions which means I cannot run them on an ASUS Chromebook Flip. More information about this is available here.

Fortunately, there is a simple workaround for this problem. Install Ubuntu Trusty Tahr instead.

sudo sh ~/Downloads/crouton -t xfce -r trusty

After doing so, you can install Git, Node.js, npm, and TypeScript on the Linux environment like normal.


 

Once you have Linux installed, you can now edit your TypeScript code using one of the editors I’ve already mentioned. When you want to build your application, you can either use the TypeScript CLI from a Linux command line in a Chrome browser window, or run it from a command line in the Linux GUI.

Optionally, you can also install a coding IDE to the Linux environment if you’d like. However, in my case since I’m using an ARM Chromebook, I’ve found that it is more difficult to find ARM builds of my favorite editors.

Know of a better way to develop applications on a Chromebook? Comment below!