Live data from Hacker News

Web Applications Should Be Compiled

ediblepet.net

111–120 of 177 posts

Re: Web Applications Should Be Compiled

#111
post #94
post #2

Not a bad troll. Not the best I've ever read, but not bad, either.

Your comment adds less to an intelligent discussion than does the article you're calling a troll. First, this isn't a troll. The guy posted a blog post on his own blog. He didn't post off-topic content to a thread and didn't try to provoke an argument in an otherwise civil conversation. The only possible way that you can characterize this as a troll is that he uses some crude language, and says some things that are u…

"Your comment adds less to an intelligent discussion than does the article you're calling a troll."

Sometimes the truth is very simple. It can be considered a troll because it is in the tone "if you don't do as I say you are an idiot, like everyone else".

Second: not all scripting languages are interpreted on the fly. In fact, many of the most popular frameworks load objects once and keep their compiled forms in memory. Even for languages that run under VMs, some of them run under JIT that, in the end, results in machine-language-like times.

Third: I have profiled a lot of web applications and most of the time they are either waiting for the pipe to deliver a request or waiting for the database to deliver the data. Very few web applications I know of do heavy processing. For those, I agree compiled code may help.

and, finally, by the time the guy finishes his C code, an equivalent competing application that uses Rails will be approaching the millionth registered user.

Re: Web Applications Should Be Compiled

#114
No, the solution is not to write web application in C, it's to make faster interpreters for higher level languages.

I like not having to worry about buffer overflows and memory management and such.

That said, I'll be interested to see what he comes up with.

Re: Web Applications Should Be Compiled

#115
Well, if I were forced to write in C these days, I would seriously write a C/C++ generator in Lisp to speed the time to market.

But if I could do it where nobody was watching, I would use a different compiled language, Lisp (SBCL) that would get good enough performance and get to market before the manly C/C++ coder.

So on a semi-serious note, why is (apparently) nobody going for the real performance kill, which is to write a framework in hand-coded assembler? Would it be twice as fast as C?

Re: Web Applications Should Be Compiled

#116
post #16

It's a valid point. I wrote the Mibbit backend from scratch in Java for these reasons. I can only start to imagine the horror I would be enduring if I'd chosen a scripting language. Having said that, choose the right tool for the job. edit: Downmod me all you like. A scripted language wouldn't handle 2k req/sec on a couple of VPSs.

I think Mibbit, much like twitter, is one of those apps that is a non-traditional webapp. While its a web based frontend the traffic and distribution of chat messages is a much different beast then what most webapps do. Java is very likely a much better choice for these reasons.

Twitter runs under serious load using "scripting languages". The issue is runtime, not language.

Re: Web Applications Should Be Compiled

#117
post #94

Earlier quoted context omitted.

Your comment adds less to an intelligent discussion than does the article you're calling a troll. First, this isn't a troll. The guy posted a blog post on his own blog. He didn't post off-topic content to a thread and didn't try to provoke an argument in an otherwise civil conversation. The only possible way that you can characterize this as a troll is that he uses some crude language, and says some things that are u…

"Your comment adds less to an intelligent discussion than does the article you're calling a troll." Sometimes the truth is very simple. It can be considered a troll because it is in the tone "if you don't do as I say you are an idiot, like everyone else". Second: not all scripting languages are interpreted on the fly. In fact, many of the most popular frameworks load objects once and keep their compiled forms in memo…

Even though the tone of the article was abrasive, it was far more interesting and insightful than the one-line comment to which I responded. Your asserted arguments for dynamic languages are well-trodden ground:

Assertion: "Some scripting languages are as fast as compiled languages."

No, not really. I challenge you to prove that statement with a non-trivial benchmark.

Assertion: "most of the time, web apps are waiting for something external to respond"

This doesn't survive a few seconds of thoughtful analysis. If a web app is spending most of it's time blocking for I/O, it's poorly designed. There's no reason that it can't be handling other requests while waiting for a DB response or a pipe. And once you've allowed for that possibility, you're back to a situation where you can handle more requests with faster software.

Empirically, this is obviously true: languages like Ruby and Python don't hold a candle to Java when it comes to web application speed. We choose them because of developer convenience, nothing more. Which brings us to...

Assertion: "C programming is terrifically slow for development. "

Ignoring the fact that there are other compiled languages than C (that are probably better choices for web development), I can tell you from experience that by the time your Rails app reaches a million registered users, 80% of your week is going to be spent either working around the myriad scalability flaws in Rails and the dog-slow nature of Ruby, or installing hardware to accommodate the load. Scaling Rails is a nightmare.

Now, it may be true that you can develop that Rails app a bit faster than you could a webapp in a compiled language, but it's a wild exaggeration to suggest that the difference is more than a few weeks of skilled developer time. It's a fallacy to imply that all compiled-code projects end up in death-march hell. Truth be told, the real reason that web apps can be written so quickly is because they're easy, and they tolerate a lot of development error. So long as there are good string processing facilities, the choice of language is a fairly minor point.

Re: Web Applications Should Be Compiled

#118
The first thing that came to into my head was 'What problem is he trying to solve?'

Does he have performance problems? Is it cost effective to solve those performance problems using C? What is the ROI?

Has the performance problem been analyzed to a degree that its been identified that its the web framework? (Most of the time a decent database index will help)

Go after the lower hanging fruit first and make decisions on quantitive data analysis.. not just your gut.

Post reply on HN