Learning

7 Jan 2015

January is a time for trying new things. My last post got me thinking about this, and conversations at work since I’ve been back have solidified my resolve. In 2015, I’m going to learn a new programming language.

This isn’t because I’m particularly dissatisfied with my current arsenal - Python and C++ have served me well for a long time, and I’m not about to abandon them and throw away the experience I’ve built up. I’m going to keep polishing my knowledge of those - including Python 3 and C++ 11/14 - along with the other languages I use for work (mainly JavaScript, GLSL and CUDA).

What I’m interested in here is something a little different. Learning new technologies, and languages in particular, is useful both in its own right, and to give you a new perspective on the familiar. I’ve long been interested in programming languages, but rarely knuckle down and learn a new one in depth. I’d like to change that.

The last few years have been pretty good as far as interesting languages go; as more code has move to the server, new languages have emerged, and old ones are getting renewed interest. Here’s are the languages that have particularly caught my attention:

  • Go seems to be getting a lot of traction, and you certainly can’t argue with its pedigree. What I’ve seen of it is sensible and pragmatic. Surprisingly, given its origins, it looks closer to being a more rigorous Python rather than a modern C or a rationalised C++, but that’s not necessarily a bad thing. My main reservation is its youth; while it has a lot of excitement now, it’s still relatively untested, and it remains to be seen how it will fare over the long term.
  • Rust, in contrast, looks like it would be a viable replacement for C++ in a lot of the situations where the latter makes sense. Moreover, as I mentioned in my previous post, it takes a lot of cues from type theory and languages like ML, which appeals to the computer scientist in me. However, like Go, I’m worried about its staying power. This is if anything even more of a concern, as Rust’s backer (the Mozilla Foundation) doesn’t have the deep pockets and killer instinct of Go’s (Google).
  • Haskell is something I’ve been curious about since I was an undergraduate, but I’ve never taken the plunge and used it for anything substantial. Over the last few years, my reservations have crystallised into something specific. I’m worried that I’ll accidentally make something none-strict, and suddenly my code will be linear (or worse) rather than constant in space. I’d assumed that this was just due to my unfamiliarity with the language, but it appears that the experts also find it difficult to reason about Haskell in this respect. Unfortunately, this is basically a deal-breaker for anything long-running like web apps, but is less of a problem for things that I’m just going to run myself (such as a compiler).
  • F# looks fascinating, and has a number of interesting features (having worked on physical units support in my last job, I find units of measure particularly intriguing). However, while no longer Windows only, that seems like its natural home. It’s also (as far as I can see) tied to the .NET environment, which seems a little more heavyweight than I’d like. (Both of these objections would of course be irrelevant if I ever found myself writing anything Windows-only; you never know…)
  • Swift is essentially the same story writ large; interesting, but single vendor. In this case, it isn’t even - yet - cross-platform or open source. That said, Apple seem likely to put consistent and continued effort in to it, which goes some way to offsetting its immaturity (it’s by far the newest language on this list). Perhaps a good choice on its home turf, but not elsewhere.
  • OCaml is, perhaps surprisingly, the final item on my list. Like Haskell, I’ve had half an eye on it for a long time. Recently, however, I seem to be hearing of more and more people making serious use of it. Part of this is undoubtedly because I know a few people who work on XenServer and related projects, where OCaml is used heavily. It’s not just them, though: Facebook has also recently been working on numerous projects (Hack, Flow, Pfff) in the language. These aren’t toys, either - they’re big, complex projects in key areas of their respective businesses. This combination of momentum and maturity should be enough to get me over the syntactic peculiarities that have niggled me before.

It should be obvious by this point that I consider none of these languages a slam dunk; they all have their problems. This shouldn’t be surprising. I’ve been around too long, and seen too many hot new things come and go, to think that any language (or framework, or service…) will be perfect. That said, I’m not looking for perfect. I’m looking for interesting and useful, and every language on the list is both.

I don’t see any need to commit myself to any one of them exclusively. I’m a (programming) polygot already, and I intend to remain one. I’ll try each out for a small project that suits it, and see what I think. The problem is that, with commitments at work and at home, my time for such projects is limited, so I need to make a decision. Which should I try first?

Having considered it, I think I’m going to go with OCaml. It has the kind of high-level abstractions that I’m missing from my current tools, but is sufficiently grounded that I can reason about it without getting a headache. I’ll find a little project to try (probably something involving parsing and data munging), and see how it goes.

And now I’ve made a public declaration of my intent, I might actually follow through on it without getting distracted by a hundred other things. Watch this space.

This site is maintained by me, Rob Hague. The opinions here are my own, and not those of my employer or anyone else. You can mail me at rob@rho.org.uk, and I'm @robhague@mas.to on Mastodon and robhague on Twitter. The site has a full-text RSS feed if you're so inclined.

Body text is set in Georgia or the nearest equivalent. Headings and other non-body text is set in Cooper Hewitt Light. The latter is © 2014 Cooper Hewitt Smithsonian Design Museum, and used under the SIL Open Font License.

All content © Rob Hague 2002-2024, except where otherwise noted.