Search code examples
language-agnosticprogramming-languages

What general purpose language should I learn next?


I'm currently participating in a programming contest (http://contest.github.com), which has as goal, to create a recommendation engine. I started coding in ruby, but soon realised it wasn't fast enough for the algorithms I had in mind. So I switched to C, which is the only non-scripting language I know. It was fast, of course, but I cringed every time I had to write a for loop, to go through the elements of an array (which was very often).

That's when it dawned: I wish I knew a fast, yet high-level language, to program all these intensive computations with ease!

So I looked at my options, but there are a lot of options these days! Here the best candidates I've found over the months, with something which bothers me about each of them (that hopefully you can clear up):

  • Clojure: I'm not sure I want to get into the whole lisp thing, I like my syntax and cruft. I could be convinced, though.
  • Haskell: Too academic? I don't really care for pure functional, I just want something which works. But it has nice syntax, and I don't mind static typing.
  • Scala: Weird language. I tried it out but it feels messy/inconsistent to me.
  • OCaml: Also wondering if this is too academic? The poor concurrency support also bothers me.
  • Arc: Paul Graham's lisp, too obscure, and again, I'm not sure I want to learn a lisp. But I trust this man!

Any advice? I really like the functional languages, for their ability to manipulate lists with ease, but I'm open to other options too. I'd like something about as fast as Java..

The kind of things I want to be able to do with lists are like (ruby):

([1, 2, 3, 4] - [2, 3]).map {|i| i * 2 } # which results in [2, 8]

I would also prefer an open-source language.

Thanks


Solution

  • Haskell is my current preference as a performant, high-level language. I've also heard very good things about OCaml, but haven't personally used it much.

    Scala and Clojure will have similar performance to Java -- slow, slow, slow! Sure, they'll be faster than Ruby, but what isn't?

    Arc is a set of macros for MzScheme, and is not particularly fast. If you want a performant LISP, try Common LISP -- it can be compiled to machine code.