Posts Tagged ‘choosing a language’

Yes, Emacs is my OS, but I still need to run external programs not written in emacs-lisp from time to time. For example, emacs doesn’t have a method for processing a section of a file – without help from an external program, you need to load the whole thing into a buffer.

Why learn a new programming language?

And no, because the pragmatic programmers told me to learn a new one every year is not a good reason. If it is something you need for work, then the choices is normally straightforward – learn whatever they tell you to learn at your firm.

Languages Used in Industry

If you don’t have a job and want to get one, choose C# if you like Microsoft, Java if you don’t or perhaps PHP if you want to do web programming. C++, Python or Perl might be reasonable choices depending on which industry you want to go into. And no, Python did not "kill" Perl nor did Ruby "kill" Python.

Language Complements

If you already know a systems language such as Java, C# or C++ it is worth learning either Python or Perl. The reverse is a weaker proposition but still true in my opinion. However, if you already know both a systems language and a scripting language, any time invested in learning a new language could be used to improve your knowledge of one of your existing languages – maybe learn a framework such as ACE, Twisted or POE.

Studying For Fun

It may be worth learning a new language if you are just learning for fun and your existing languages don’t cover a particular problem area that you are interested in. For example, if you want to write GUIs and only know C++ and Perl maybe you should learn Python so you can use wxPython (just kidding!).

The problem then is that you can’t do a thorough evaluation of a new language in a small amount time. Perhaps the best you can do is to list features that are important to you and exclude languages on that basis.

So for me, I don’t like to write C++ in my limited spare time and my second language, Perl has a few minor flaws such as threading1. I’m looking for a replacement for pottering about with. My big ticket requirements are:

  • Nothing to do with .NET
  • Portable to at least Linux and Windows
  • I would prefer run-time size to be small for simple program
  • It must have a REPL I can run from Emacs
  • It needs to have fairly complete libraries (which implies)
  • It must have a reasonable size user community
  • Pre-emptive threading would be nice

The JVM Languages

JVM based languages neatly solve the libraries issue and you get threading and portability too. The two languages I would consider here are Clojure and Scala. I’m more interested in the former but I’m a bit concerned about run-time size. From what people tell me, three or four Java clients is all a decent PC can take before it falls over.

D, Haskell, Ocaml

I suspect all of these make relatively small runtimes. Haskell immediately excludes itself as any language where I can’t put a Printf where I want sucksis not the language for me.

Scheme / Common Lisp

There are simply too many scheme implementations which must affect the size of the user community so I’m ruling scheme out. And if I’m going to run a Common Lisp VM, why not use Clojure instead and get the Java Libraries for free?


Lua covers most of the points. I just need to check if it has a REPL.

So following that set of (weak) justifications, my shortlist consists of Clojure, Ocaml, Lua and Perl of course. Next I’m going to do a very basic check of runtime size.

1. Since discovering POE, I haven’t needed threads so perhaps I should admit that whenever raw speed is unimportant (and that is usually the case) Perl might be my perfect language.

Read Full Post »


Get every new post delivered to your Inbox.