06 April 2013

I recently switched to the Samsung ARM Chromebook for all my laptop needs. The pitch it’s quite appealing, 200 quid, dual core ARM CortexA15s, good keyboard, totally fan-less (CPU is passively cooled), good battery life, 1kg weight. The one downside is it’s quite limited RAM size, just 2GB. But with a decent swap file, I’m running multiple JVMs (with Datomic, Elasicsearch, CLJS compiler etc without any hickups).

Out of the box it runs ChromeOS, which I have to say is pretty stellar for browsing and consuming content on the web. It is also possible to run any Linux you wish on this machine, google has an outspoken strategy to enable it.

I use a dual-boot setup where I have the ChromeOS system on the internal SSD and Chrubuntu (currently 12.04) on an SDCard. So if you buy one of these chromebooks, also get a decent SDCard (I have a 32Gb Sandisk Extreme). Setting up Chrubuntu is a breeze, and after the base system is installed you need to spend some time installing the other essential development tools. It’s not as easy as homebrew on OSX, but if you have any Linux experience (or want to gain some) it’s straight forward.

Edit: As pointed out in the comment section below, I decided to give Crouton a go. This is some clever scripts around debootstrap, that gives a full Ubuntu install inside Chrome OS. You can then launch it from the Crosh (developer) shell and drop into a (for instance) 13.04 Xfce environment, and install whatever you want. This is very convenient, since you can easily switch back to Chrome OS (which runs in parallel) for flash websites etc. It also solves some of the annoyances you’ll face when booting straight into Chrubuntu (like hardware accelerated graphics and the resume on sleep issue). The price you pay is slightly less memory available for you Ubuntu system, since you share all resources with Chrome OS, and chrome is still running ‘on the other side’. If you install your Cruoton environment on the SSD, be very careful at the “scary boot screen” - you might end up wiping your entire environment and lose all your files.

Now, since we are running on an ARM processor, any prebuilt x86 binaries won’t run. The Chrubuntu distro is pretty complete, but you probably have to build some stuff yourself. One thing to keep in mind when working with Linux on ARM hardware is pay extra attention to “hard-float” vs “soft-float” binaries. On the Samsung ARM Chromebook you will be running armhf which is the hard-float option. Unfortunately soft-float ELFs is not binary compatible with armhf, thus you might experience crashes if you don’t pass the correct flags to ./configure.

Fortunately it’s not a big problem. Emacs builds nicely and you can snap up a JVM for armhf here. On my system I also work quite a bit with node.js, when building it you must enable HARDFLOAT and disable the snapshot feature in v8 (otherwise v8’s ARM JIT will not behave correctly).

Once you have Emacs and Java8/armhf, just can install and run leiningen as normal, jack-in in Emacs and hack away! You will quickly forget you’re on ARM hardware, it’s just normal Ubuntu. Well, you might notice that there aren’t any CPU fans, and no 2nd degree burns on your legs :-)

As you can see in the picture above, I’m also working a bit on my Raspberry Pi. This work is greatly helped by having developer spec-ed ARM hardware to work on. All binaries can be copied verbatim to/from the PI – no more ARM Emulators on x86 hardware!

I recommend the Samsung ARM Chromebook for Clojure development!



Share this post

blog comments powered by Disqus