Update: I originally posted this article in May 2008, but it is still relevant. I have kind of found a solution that I’m trying out now, namely moving to a fairly minimalist language, Scheme. It is well suited to the main area I work in (NLP/AI), can be used purely functionally, and has such a simple syntax that it should be relatively easy to write run-times for it on various platforms if necessary.
In the meantime, however, the need for using different platforms has become less pressing for me, as I mainly do this as a work-related hobby nowadays.
I’m having a problem with languages. Not that there is something I cannot do in my favourite language, but rather that there are distinct ecosystems for various languages, and they are usually fairly exclusive. For example, in order to program in a web context you need either PHP, or alternatively be prepared to run your own server if you want to use Java or Erlang. I’m not talking about businesses or commercial operations here, just the private/academic/small scale non-funded project range.
Most of the language processing software I’ve written is in Java, because it works well and can run almost everywhere (but not on shared webhosts). It’s useful to distribute applications, as people can use it on Linux, Macs and even Windows. But I’ve now pretty much switched to Erlang, as I put high hopes on the future of parallel programming, and I want my software to take advantage of multi-core processors. However, Erlang programs are not as easily shared and distributed as Java apps are. Problem.
Ideally I’d like to write all my programs only once. This was kind of the promise of Java, and it worked mostly. At some point I even considered working on an interpreter for JVM bytecode written in PHP (so that my Java classes would work without having to be re-coded in PHP itself), but aside from the possibly terrible performance it seemed too daunting a project. Maybe Erlang could be compiled into JVM bytecodes? Of course you’d lose all the concurrency features etc, but at least you could deploy it together with a Java app. A bit like Scala, almost. Update: There is a (defunct?) project that does attempt exactly that: Erlang on the JVM.
If PHP wasn’t such a ghastly language I’d be happy to code everything in that, but it seems too much of a sacrifice. But for most purposes I would need at least those three:
- Java for applications to be deployed to other people
- PHP for stuff running on shared webservers
- Erlang for research and cutting-edge stuff
And there is little to no common ground between them. Sigh.