Tagged: Scala

My Next Language

I have a decent background in programming languages. In a professional context (i.e., for real money) I’ve used C#, Scheme (my favorite), Lisp, and C. For projects I’ve also used Java, C++, and Python. For tinkering around I’ve used Prolog, Haskell, OCaml, Factor and Javascript. I’ve studied many more, including Go, F#, Ruby, Scala, Clojure, and on and on.

I want to pick a new language for large-scale production software. Mostly backend data processing and some web development. Here are my criteria, in order of importance:

Static typing w/ inference: Though I still love Scheme, I want the compiler to catch as many errors as possible. Static types are great but verbose. Inference means I only need to add a few declarations to get type safety. Other safety features would be great, like dependent types and C#’s Contracts. This eliminates all dynamically typed languages from consideration. Languages without inference are less likely to get picked.

Performance within 5x of C: If a language is slower than this it can become a hinderance for some projects. This eliminates all languages that run on an interpreter.

Vibrant community: This is a painful one, because it eliminates lots of interesting languages that aren’t mainstream. If you want to ask questions, get help, get hired or hire people, a popular language is necessary.

Libraries & Tools: A major benefit of a big community is access to lots of libraries and tools. Time to market is critical, and it’s better to grab a library than roll your own. Tools like IDEs, debuggers, and other nifty tools really help (like an interpreter!). Also, I’d like support for running on different cloud services, like Heroku or Google Cloud.

Ease of use: I love Scheme because it is small and simple. Even C is still a brilliant diamond. C++ is just too much. I really like Scheme’s macro system, so some kind of language extensibility would be great. Unfortunately most languages pile on features rather than simplify.

Platform neutral: I want to be able to use this language on Linux and Windows, but also iOS and Android if possible.

Support for parallelism: CPUs are only going to add more cores. It is important that the language/runtime not disallow parallelism (e.g. the GIL in Python). Even better would be support for distributed programming, like Erlang.

The contenders, ranked by meeting my criteria:

  1. Scala: Stands on top of the gigantic Java ecosystem. The Akka library offers good parallelism. A bit more complex than I’d like. The only thing missing is support for writing iOS apps.
  2. F#: With Xamarin it really runs everywhere, including iOS and Android. It stands on the less gigantic .NET ecosystem.
  3. Go: No mobile dev, a small but growing community. Go doesn’t have type inference, but declarations don’t look too bad. Support for parallelism is excellent.
  4. D: No mobile dev and a small community. Facebook could push D more into the mainstream. Less complex than C++, but still more complex than I’d like. Why isn’t D more popular?
  5. Haskell: No mobile, small but influential community. Probably the best language here. But integration with cloud services would be poor, and connecting with various middleware products might be complex.
  6. Swift: It’s only been a month, but Apple suggested it could be used for server-side code as well. With Apple and iOS behind it, there’s no doubt this will have a large community. It probably won’t run on Windows nor Android. No support for parallelism beyond GCD.
  7. Rust: In the same space as D, this language is certainly buzzword compliant. It’s too early to tell if it will become popular.

The finalists are Scala and F#, which are really in the same space. The difference is the JVM is excellent everywhere, but Mono can be quite a bit slower. Also, lots of big companies are using Scala, which means the community will grow bigger over time.

The winner is Scala. 

 

Advertisements