Live data from Hacker News

Twitter: From Ruby on Rails to the JVM [video]

ontwik.com

91–95 of 95 posts

Re: Twitter: From Ruby on Rails to the JVM [video]

#91

Earlier quoted context omitted.

I don't know if my anecdotal evidence bears this out, but I admit that it is just that...anecdotal. People are still using C and C++ to write low level code. Databases, package managers, games, etc. Then there are the 'application developers' as you named them, writing http service endpoints, web apps, and the like. It seems java still owns the colossal corporate stacks. I hear things like "it is easier to hire" and…

My opinions are anecdotal at best as well and that's the reality of software development. There's no research that can state that X is better than Y whether it is programming languages, methodologies, architectures, patterns, etc. I don't deny the reality that people are still writing C/C++ code in the field of embedded devices, games, something that requires fast performance with a very low memory usage. On the othe…

    > On the other hand, many people seem to come out and say that Ruby is _very_ slow. 
    > Is it heaven-and-earth slow?
Comparatively, I would say yes. Granted, most of the time it won't matter because you are waiting on IO (disk/network), but if you are doing cpu intensive work, it is slow and you probably need to drop down to C or offload that work to another service.

    > How is Erlang more scalable than Java? In what area? horizontal vs vertical scaling?
    > developer's productivity (or team performance) scale? performance? speed? Erlang seems 
    > to excel in a niche area (in a positive speaking).
My guess would be in single server scalability. Erlang's write-once variables and actor model, combined with a good VM ("green processes") make it very single-server-scalable (verticle). It also has good built in node-to-node communication mechanisms (horizontal). Performance is probably slower than Java though. And I imagine the developer pool is much more limited than that of Java.

    > What about Haskell/Ada, how are they safer than Java? 
    > Do they have better type-systems? handles NULL better than Java? 
    > Bulletproof from developers? detect more bugs?
I meant safer in the type-safety sense, yes. There are also classes of static analysis tools for both. Granted, my knowledge of these languages is quite limited.

I certainly see your points (especially about liking the code hygiene of python), and agree that Java is not going anywhere soon. I guess I don't understand why a startup, or individual developer, would choose Java over other languages, even other languages on the JVM, for new projects.

Thanks for the good discussion. :)

Re: Twitter: From Ruby on Rails to the JVM [video]

#93

Earlier quoted context omitted.

My opinions are anecdotal at best as well and that's the reality of software development. There's no research that can state that X is better than Y whether it is programming languages, methodologies, architectures, patterns, etc. I don't deny the reality that people are still writing C/C++ code in the field of embedded devices, games, something that requires fast performance with a very low memory usage. On the othe…

> On the other hand, many people seem to come out and say that Ruby is _very_ slow. > Is it heaven-and-earth slow? Comparatively, I would say yes. Granted, most of the time it won't matter because you are waiting on IO (disk/network), but if you are doing cpu intensive work, it is slow and you probably need to drop down to C or offload that work to another service. > How is Erlang more scalable than Java? In what are…

Java ecosystem has a lot of static analysis tools that can integrate to almost all popular IDEs and Continuous Integration systems. Findbugs, PMD, JDepend, Sonar (recommend to check Sonar).

Checkstyle is another tool that I use since I'm kind of the annoying dude when it comes to code-style. (Have you seen GWT API code? it's like written by one person as opposed to a few developers with different perceptions of "readable" code. I like that kind of thing).

There are a few reasons why startup/individual dev would choose Java:

1) Previous experience in Java

2) Java fits better for the type of problems to solve (intensive computational that requires Hadoop like infrastructure)

3) Emotionally attached to static/compiled language with nice IDE so that one can navigate the source code easily whether the code base is large or small (sometime not all decisions are rational and I'm okay with that because developing software requires more than technical skill; it also requires passion).

4) Marketing (if you're targeting the enterprises). Zimbra, Jive Software, Compiere, Alfresco, Day software, Liferay, Salesforce used to be startups.

Java ecosystem seems to learn and grow in a much better speed thanks to the following actors:

- Rails (Spring Roo, Spring MVC, JPA 2.0, and possibly MVC framework from the upcoming JEE releases)

- C# (Java 7 new features, Java 8 closures/lambda. Yes, Lisp does this first, but I think C# forces Java to implement closures more than any of its competitors).

- REST/JSON/WS (Check out the latest JAX-RS, supports REST, JSON, XML, Atom-Feed, and JAX-WS)

- I/P/SaaS + Cloud Computing (Targeted for Java EE7, deployment, infrastructure to support multi-tenant, etc).

NB: Just so that I don't sound like a Java fan-boy, I use Java by day but I use and help to promote and organize Python community overseas (of course by not comparing Python vs Java :)).

Re: Twitter: From Ruby on Rails to the JVM [video]

#94
I think most people misunderstand the point made by Raffi...yes, JVM has awesome performance, but never try to solve performance issue up front by sacrificing the agility offered by RoR. Not everyone is building Twitter, you don't even know whether you will hit the point where the VM is blocking your way. If you blame all the performance issue to the VM level, you are simply doing it wrong...In 90% of the cases, MRI is fast enough and meet your requirement (GitHub, Groupon, Living Social and many others are using RoR BTW). Twitter is very pragmatic at this respect, they have tried all the means to scale the app on RoR before they move to the JVM. Never ever try to solve a requirement that doesn't even exist in your own app...

Re: Twitter: From Ruby on Rails to the JVM [video]

#95

I think most people misunderstand the point made by Raffi...yes, JVM has awesome performance, but never try to solve performance issue up front by sacrificing the agility offered by RoR. Not everyone is building Twitter, you don't even know whether you will hit the point where the VM is blocking your way. If you blame all the performance issue to the VM level, you are simply doing it wrong...In 90% of the cases, MRI…

The point is you probably never need that performance gain on the VM level (YAGNI) at all. Things are changing very fast in software development, your project could die or fail long before you really think about performance optimization on the VM level. But when you start a project and think that my project will fail because I use Rails and Rails doesn’t scale, you are doing it all wrong! What you really need is a tool that helps you iterate faster. Rails falls into this category. And that’s the productivity gain that I am thinking when starting a company.

As a pragmatic approach, a half century of software engineering says that you should write the code first and worry about making it faster only if it is too slow. Donald Knuth is right: Premature optimization is the root of all evil. Don’t merely let the VM performance metric blind you to this fundamental truth. If you are chasing for a performing language, Java/Scala is not your ultimate solution, C/C++ is, even Erlang.

I actually don’t see a problem with “performance” emerging as the requirement in the Ruby world sooner than others, say Java/Scala, because this “sooner” is very contextual and depends a lot on the implementation. To give you more info, GitHub is on RoR since it started, and till now they haven’t hit the so-called “Rails does not scale” point ( http://teachmetocode.com/podca... ). So are many other projects. Besides, think about Twitter, they only recently try to port everything to the JVM, after Rails has served them a couple years. All these facts tell you, this “sooner” may never happen to your own app, and most importantly, Rails can scale, although it may not scale as well as others! But once you hit the point where Rails, or Ruby in general, doesn't meet your performance requirement (assuming you are lucky enough to build another Twitter), do what Twitter suggests you to do in the video. Is that too late? Not at all. Because by then, you have the resources to do whatever you want, even inventing a VM that is more performing than JVM.

To summarize, the Ruby VM was fast yesterday, is still fast today, and will be faster tomorrow. In 90% of the cases, it's just fast enough. Do I need the performance gain by switching to JVM? Don't know yet. It'd be better to let the market drive you. Does Rails provide the agility I want to start a project? 100% hell yeah!

Post reply on HN