Live data from Hacker News

Web Applications Should Be Compiled

ediblepet.net

11–20 of 177 posts

Re: Web Applications Should Be Compiled

#11
post #4

Ranting aside, this seems like a valid complaint. Scaling and performance seem to be reasonably important in web applications, so why not write them in C? If the only complaint is the lack of good tools, why not build those tools? Disclaimer: I don't actually work on web apps, and therefore have no experience with these things.

If your site starts to take a performance hit in rendering pages, you can simply write a module in C to handle the part of the script that's using an excessive amount of CPU time, and keep the rest in script.

But for most web apps, rendering HTML pages from script is not the bottleneck, it's the interaction with the database, and the solution is intelligent caching to reduce load on the database. The tools to mitigate these problems are already written in C (memcached, etc).

Re: Web Applications Should Be Compiled

#13
I think you don´t have to stick with C (or any another language ) for everything. Each language are good for something. Right now, for example, i´m working in a financial intelligent software analyzer. I wrote the web crawler in ruby (not rails) and now i´m planing to write the core of the system, the decision maker, at Lisp. I think a programmer should not be sticked with just one language, there´s a lot of cool things out of the C world. You dont have to write an entire C framework to build an web apps at C ... it´s just too troublesome. You have another challenges. But when it comes to process data very fast in your server, so maybe you should consider another language.

Re: Web Applications Should Be Compiled

#14
Most sites aren't CPU or memory intensive. If you are lucky enough to have enough users for that to be a concern you can add more servers. Sites normally bottle neck around the database and writing front end code in C is distraction from fixing the real problem which should be scaling the database.

Re: Web Applications Should Be Compiled

#15
That is why there are things called "application servers". Java is not perfect but it has a fine feature called JIT (Just In Time compiling) that produces machine code whenever it makes sense. Raw compiled language goes against the current trend for virtualization, whose goal is to save energy too. So in my opinion JIT is a good solution.

Re: Web Applications Should Be Compiled

#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.

Re: Web Applications Should Be Compiled

#17
Web site performance problems usually don't have much to do with the raw executing speed of the language they're written in. The problems derive from poor understanding of how to handle concurrent connections. If your app is written in C, but is accessed through a CGI interface - starting a process for each request - then it's going to be slow. Similarly if you write a web server which makes blocking connections to a backend database, your server will be slow. If you use threads to handle concurrent connections, you're going to allocate 2mb stacks for each user - and your website is going to suck. This all has little to do with how fast a language can invert a matrix.

Re: Web Applications Should Be Compiled

#18
post #7

In web the model is different: You develop an app, push it live and find out what works and what does not, change and iterate. This means that doing the iterations with minimum time and effort are important than worrying about scalability and performance. You can always throw hardware at the perfortmace problem. If you get enough traffic to become worried about performace, that itself is the mark of success. But to b…

You can always throw hardware at the performance problem.

No, you can't. That's what scalability means. If you don't have scalability, then additional hardware will only take you so far before you begin wasting it.

Re: Web Applications Should Be Compiled

#20
post #10
post #3

> So this is why I’m writing a web framework in C. Why C, why not assembly? In fact, you know what real programmers use? -- http://xkcd.com/378/ > Grow the fuck up... > finding Rails developers is fucking impossible... You grow up > ediblepet.net is proudly powered by WordPress When will you release your compiled blog platform?

Oh, you haven't heard? He ported WordPress to C. I was pretty impressed.

Did he outsource it to Tim Ferriss or something?! I thought he was busy finishing off Duke Nukem Forever.
Post reply on HN