Contact Us

InfoQ: Dean Wampler on Programming Languages

Ruby on Rails, Technologies | February 25, 2010
You also program in Ruby, right? Three languages! Can you contrast the 3 languages Scala, Clojure and Ruby?
That’s a very interesting thing to think about, because Clojure and Ruby have sort of a similar feel in the sense that they are both more dynamically typed than statically typed. Clojure has an interesting relationship with Java, obviously, because it lets you use Java objects, but it doesn’t have type annotations all over the place, like you would have in Java or Scala. I think this general debate of static versus dynamic typing is kind of pointless in some sense, meaning that a lot of times it’s the application that really should dictate what’s best.If you are building something like a typical website that may need a lot of iterations very quickly and there is an informal model of the domain, then maybe it’s not so important to have the formalism of type theory. But, on the other hand, if you are building something that you wanted to behave in a mathematically precise way, then it’s great to have it. They type system of statically language that bakes in the almost provably correct behavior, at the fundamental building blocks. For example, if I’m building a financial application that manages money in some sense, I’d be more likely to want a statically typed language like Scala where I can very precisely specify the behavior of money.

Then, build my account objects and so forth on top of that, knowing that they will be robust at this very fundamental level. But, if I’m building a website, where users may be specifying withdrawals and transfers, I don’t necessarily care about that kind of type safety at that level. I would like to have the dynamism, the productivity that I get from a language like Ruby, so I’d be more likely to use Ruby on that part of the application. I could very easily see JRuby with Rails running the website and Scala or Clojure business to your code that’s handling preciseness of getting money transactions right.

JVM seem to be a place programming languages converge.

jRuby on Rails running web apps + Scala / Clojure / Java handling money transactions and other high reliability, high performance stuffs is very compelling.